Skip to content

Commit eadb582

Browse files
chore(rollup): Use same rollup onwarn function as uirouter/core
1 parent b644bb8 commit eadb582

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

rollup.config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,21 @@ if (MINIFY) plugins.push(visualizer({ sourcemap: true }));
3333

3434
let extension = MINIFY ? '.min.js' : '.js';
3535

36-
// Suppress this error message... there are hundreds of them. Angular team says to ignore it.
37-
// https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
38-
function onwarn(warning) {
39-
if (warning.code === 'THIS_IS_UNDEFINED') return;
40-
console.error(warning.message);
41-
}
36+
const onwarn = (warning) => {
37+
// Suppress this error message... https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
38+
const ignores = ['THIS_IS_UNDEFINED'];
39+
if (!ignores.some(code => code === warning.code)) {
40+
console.error(warning.message);
41+
}
42+
};
4243

4344
function isExternal(id) {
4445
// @uirouter/core and ui-router-rx should be external
4546
// All rxjs and @angular/* should be external
4647
// except for @angular/router/src/router_config_loader
4748
let externals = [
4849
/^ui-router-rx/,
50+
/^@uirouter\/rx/,
4951
/^@uirouter\/core/,
5052
/^rxjs/,
5153
/^@angular\/(?!router\/src\/router_config_loader)/,
@@ -97,6 +99,7 @@ const CONFIG = {
9799
'rxjs/operator/concatMap': 'Rx.Observable.prototype',
98100

99101
'@uirouter/core': '@uirouter/core',
102+
'@uirouter/rx': '@uirouter/rx',
100103
'ui-router-rx': 'ui-router-rx',
101104
'@angular/core': 'ng.core',
102105
'@angular/common': 'ng.common',

0 commit comments

Comments
 (0)