使用vue-cli的--report代替webpack-bundle-analyzer

master
toesbieya 6 years ago
parent e8f9bb54b8
commit c0524a26ee
  1. 5
      vue/full/package.json
  2. 6
      vue/full/vue.config.js

@ -4,7 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build --report",
"svgo": "svgo -f src/asset/icon/svg --config=src/asset/icon/svgo.yml"
},
"dependencies": {
@ -32,8 +32,7 @@
"sass-loader": "^8.0.2",
"svg-sprite-loader": "^4.3.0",
"svgo": "^1.3.2",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.6.1"
"vue-template-compiler": "^2.6.11"
},
"postcss": {
"plugins": {

@ -2,9 +2,6 @@
const path = require('path')
const settings = require('./src/config')
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const EMPTY_PLUGIN = {apply: () => ({})}
function resolve(dir) {
return path.join(__dirname, dir)
@ -61,8 +58,7 @@ module.exports = {
threshold: 10 * 1024, //对10K以上的数据进行压缩
minRatio: 0.8,
deleteOriginalAssets: false, //是否删除源文件
}),
settings.isDev ? EMPTY_PLUGIN : new BundleAnalyzerPlugin()
})
]
},
chainWebpack(config) {

Loading…
Cancel
Save