编译删除console

This commit is contained in:
luyuan 2020-11-11 10:50:04 +08:00
parent 00a4dee4ec
commit da50f3a8dc
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
3 changed files with 12 additions and 1 deletions

View File

@ -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]
}

View File

@ -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",

View File

@ -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"