From ae7bbd46d8d7c63c51301c206dc6d339ae8c1d9d Mon Sep 17 00:00:00 2001 From: Aaron Wang Date: Fri, 20 Jan 2017 16:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A810.x=E7=9A=84named=20exports?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决在webpack中配置了babel的sage-x之后引起的Object.keys(__vue_script__).length === 2引起误报的问题 --- lib/loader.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/loader.js b/lib/loader.js index bb78486d6..2a8703b0b 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -216,9 +216,7 @@ module.exports = function (content) { // check and warn named exports if (!this.minimize) { output += - 'if (__vue_script__ &&\n' + - ' __vue_script__.__esModule &&\n' + - ' Object.keys(__vue_script__).length > 1) {\n' + + 'if (Object.keys(__vue_script__).some(function (key) { return key !== "default" && key !== "__esModule" })) {\n' + ' console.warn(' + JSON.stringify( '[vue-loader] ' + path.relative(process.cwd(), filePath) + ': named exports in *.vue files are ignored.'