From 95435c0a555503e2813ed93daa560a20a5bd724d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Mon, 11 Nov 2019 17:03:14 +0800 Subject: [PATCH] remove THIS_IS_UNDEFINED warning during es transformation --- demo/rollup.config.js | 4 ++++ js-framework/rollup.config.js | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/demo/rollup.config.js b/demo/rollup.config.js index d7acfe96..350e6bb7 100644 --- a/demo/rollup.config.js +++ b/demo/rollup.config.js @@ -15,5 +15,9 @@ export default bundles.map(bundle => { commonjs() ], external: ['reflect-metadata', 'doric'], + onwarn: function(warning) { + if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; } + console.warn( warning.message ); + } } }) \ No newline at end of file diff --git a/js-framework/rollup.config.js b/js-framework/rollup.config.js index e793574e..6cec211a 100644 --- a/js-framework/rollup.config.js +++ b/js-framework/rollup.config.js @@ -12,7 +12,11 @@ export default [ }, plugins: [ resolve({ mainFields: ["jsnext"] }), - ] + ], + onwarn: function(warning) { + if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; } + console.warn( warning.message ); + } }, { input: "build/index.js", @@ -23,7 +27,11 @@ export default [ plugins: [ 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", @@ -34,6 +42,10 @@ export default [ plugins: [ resolve({ mainFields: ["jsnext"] }), ], - external: ['ws'] + external: ['ws'], + onwarn: function(warning) { + if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; } + console.warn( warning.message ); + } }, ] \ No newline at end of file