@@ -4,23 +4,31 @@ import progress from 'rollup-plugin-progress';
4
4
import sourcemaps from 'rollup-plugin-sourcemaps' ;
5
5
import visualizer from 'rollup-plugin-visualizer' ;
6
6
7
- var MINIFY = process . env . MINIFY ;
7
+ const MINIFY = process . env . MINIFY ;
8
8
9
- var pkg = require ( './package.json' ) ;
10
- var banner =
9
+ const pkg = require ( './package.json' ) ;
10
+ const banner =
11
11
`/**
12
12
* ${ pkg . description }
13
13
* @version v${ pkg . version }
14
14
* @link ${ pkg . homepage }
15
15
* @license MIT License, http://www.opensource.org/licenses/MIT
16
16
*/` ;
17
17
18
- var uglifyOpts = { output : { } } ;
18
+ const uglifyOpts = { output : { } } ;
19
19
// retain multiline comment with @license
20
20
uglifyOpts . output . comments = ( node , comment ) =>
21
21
comment . type === 'comment2' && / @ l i c e n s e / i. test ( comment . value ) ;
22
22
23
- var plugins = [
23
+ const onwarn = ( warning ) => {
24
+ // Suppress this error message... https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
25
+ const ignores = [ 'THIS_IS_UNDEFINED' ] ;
26
+ if ( ! ignores . some ( code => code === warning . code ) ) {
27
+ console . error ( warning . message ) ;
28
+ }
29
+ } ;
30
+
31
+ const plugins = [
24
32
nodeResolve ( { jsnext : true } ) ,
25
33
progress ( { clearLine : false } ) ,
26
34
sourcemaps ( ) ,
@@ -29,7 +37,7 @@ var plugins = [
29
37
30
38
if ( MINIFY ) plugins . push ( uglify ( uglifyOpts ) ) ;
31
39
32
- var extension = MINIFY ? ".min.js" : ".js" ;
40
+ const extension = MINIFY ? ".min.js" : ".js" ;
33
41
34
42
const CONFIG = {
35
43
moduleName : '@uirouter/core' ,
@@ -41,6 +49,7 @@ const CONFIG = {
41
49
exports : 'named' ,
42
50
plugins : plugins ,
43
51
banner : banner ,
52
+ onwarn : onwarn ,
44
53
} ;
45
54
46
55
export default CONFIG ;
0 commit comments