Commit 6d8fe91d authored by 高宇's avatar 高宇

打包压缩

parent 95c1b0c5
......@@ -14,6 +14,8 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
},
"dependencies": {
"crypto-js": "4.1.1",
"compression-webpack-plugin": "^1.1.12",
"@riophae/vue-treeselect": "^0.4.0",
"axios": "0.18.1",
"bpmn-js": "^6.1.1",
......
......@@ -21,6 +21,9 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 8080 // dev port
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
......@@ -99,6 +102,15 @@ module.exports = {
}
},
configureWebpack: {
plugins: [
new CompressionWebpackPlugin({
filename: '[path].gz[query]', // 提示compression-webpack-plugin@3.0.0的话asset改为filename
algorithm: 'gzip',
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
threshold: 10240,
minRatio: 0.8
})
],
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: name,
......
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