From da50f3a8dcf6295033c5a4b61375206758de49e8 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Wed, 11 Nov 2020 10:50:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=88=A0=E9=99=A4console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 7 ++++++- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index e955840..96ef322 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,10 @@ +let build = [] +if (process.env.NODE_ENV === 'production') { + build = ['transform-remove-console'] +} module.exports = { presets: [ '@vue/cli-plugin-babel/preset' - ] + ], + plugins: [...build] } diff --git a/package.json b/package.json index 4b9544e..2fee0c7 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0-0", "@vue/eslint-config-typescript": "^5.0.2", + "babel-plugin-transform-remove-console": "^6.9.4", "eslint": "^6.7.2", "eslint-plugin-vue": "^7.0.0-0", "node-sass": "^4.14.1", diff --git a/yarn.lock b/yarn.lock index 29f4169..27c8437 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2151,6 +2151,11 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" +babel-plugin-transform-remove-console@^6.9.4: + version "6.9.4" + resolved "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" + integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"