1
1
import nodeResolve from 'rollup-plugin-node-resolve' ;
2
- import { uglify } from 'rollup-plugin-uglify ' ;
2
+ import { terser } from 'rollup-plugin-terser ' ;
3
3
import sourcemaps from 'rollup-plugin-sourcemaps' ;
4
4
5
5
const MINIFY = process . env . MINIFY ;
@@ -27,9 +27,9 @@ banner += `
27
27
* @license MIT License, http://www.opensource.org/licenses/MIT
28
28
*/` ;
29
29
30
- const uglifyOpts = { output : { } } ;
30
+ const terserOpts = { output : { } } ;
31
31
// retain multiline comment with @license
32
- uglifyOpts . output . comments = ( node , comment ) => comment . type === 'comment2' && / @ l i c e n s e / i. test ( comment . value ) ;
32
+ terserOpts . output . comments = ( node , comment ) => comment . type === 'comment2' && / @ l i c e n s e / i. test ( comment . value ) ;
33
33
34
34
const onwarn = ( warning ) => {
35
35
// Suppress this error message... https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
@@ -41,7 +41,7 @@ const onwarn = (warning) => {
41
41
42
42
const plugins = [ nodeResolve ( { jsnext : true } ) , sourcemaps ( ) ] ;
43
43
44
- if ( MINIFY ) plugins . push ( uglify ( uglifyOpts ) ) ;
44
+ if ( MINIFY ) plugins . push ( terser ( terserOpts ) ) ;
45
45
46
46
const extension = MINIFY ? '.min.js' : '.js' ;
47
47
0 commit comments