remove THIS_IS_UNDEFINED warning during es transformation

This commit is contained in:
王劲鹏 2019-11-11 17:03:14 +08:00
parent a1ca0fabd3
commit 95435c0a55
2 changed files with 19 additions and 3 deletions

View File

@ -15,5 +15,9 @@ export default bundles.map(bundle => {
commonjs() commonjs()
], ],
external: ['reflect-metadata', 'doric'], external: ['reflect-metadata', 'doric'],
onwarn: function(warning) {
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
console.warn( warning.message );
}
} }
}) })

View File

@ -12,7 +12,11 @@ export default [
}, },
plugins: [ plugins: [
resolve({ mainFields: ["jsnext"] }), resolve({ mainFields: ["jsnext"] }),
] ],
onwarn: function(warning) {
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
console.warn( warning.message );
}
}, },
{ {
input: "build/index.js", input: "build/index.js",
@ -23,7 +27,11 @@ export default [
plugins: [ plugins: [
resolve({ mainFields: ["jsnext"] }), resolve({ mainFields: ["jsnext"] }),
], ],
external: ['reflect-metadata'] external: ['reflect-metadata'],
onwarn: function(warning) {
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
console.warn( warning.message );
}
}, },
{ {
input: "build/index.debug.js", input: "build/index.debug.js",
@ -34,6 +42,10 @@ export default [
plugins: [ plugins: [
resolve({ mainFields: ["jsnext"] }), resolve({ mainFields: ["jsnext"] }),
], ],
external: ['ws'] external: ['ws'],
onwarn: function(warning) {
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
console.warn( warning.message );
}
}, },
] ]