Commit 3ca7ff60 by 张超军

打包去除console

parent 58226cec
// module.exports = {
// presets: ["@vue/cli-plugin-babel/preset"]
// };
let plugins = [];
if (process.env.NODE_ENV === "production") { // todo if判断是否打包,打包环境下控制台去掉console.log,也可去掉if判断,整个项目不会出现console.log(不建议)
plugins.push("transform-remove-console");
}
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
presets: ["@vue/cli-plugin-babel/preset"],
plugins: plugins
// presets: ['@vue/app'],
// plugins: ["@babel/plugin-proposal-optional-chaining"]
};
......@@ -2689,6 +2689,12 @@
"object.assign": "^4.1.0"
}
},
"babel-plugin-transform-remove-console": {
"version": "6.9.4",
"resolved": "https://registry.npmmirror.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz",
"integrity": "sha512-88blrUrMX3SPiGkT1GnvVY8E/7A+k6oj3MNvUtTIxJflFzXTw1bHkuJ/y039ouhFMp2prRn5cQGzokViYi1dsg==",
"dev": true
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",
......
......@@ -49,6 +49,7 @@
"@vue/eslint-config-prettier": "^6.0.0",
"axios": "^0.18.1",
"babel-eslint": "^10.1.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"compression-webpack-plugin": "^6.0.4",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment