Commit 42459797 authored by chenqikuai's avatar chenqikuai

add terser and compression

parent ad4af5ba
This diff is collapsed.
......@@ -47,6 +47,7 @@
"@vue/eslint-config-typescript": "^7.0.0",
"autoprefixer": "^9.8.6",
"babel-plugin-import": "^1.13.3",
"compression-webpack-plugin": "^6.1.1",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"less": "^3.0.4",
......@@ -56,6 +57,7 @@
"postcss": "^7.0.36",
"sass-loader": "^7.3.1",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.9",
"terser-webpack-plugin": "^4.2.3",
"typescript": "~4.1.5",
"vue-qr": "^2.5.0",
"vue-template-compiler": "^2.6.11"
......
const CompressionWebpackPlugin = require("compression-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
// ...other vue-cli plugin options...
outputDir: 'kor',
......@@ -28,7 +32,25 @@ module.exports = {
}
}
}
}
},
configureWebpack: {
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
compress: {
drop_console: true, // 默认false -- 移除console.*(console.log、console.error等等)
},
},
}),
],
},
plugins: [
new CompressionWebpackPlugin(),
],
},
// pwa: {
// name: 'My App',
// themeColor: '#4DBA87',
......
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