这是我的vue-cli3的配置文件
vue.config.js:
const path = require('path')
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
module.exports = {
publicPath: './',
lintOnSave: true,
chainWebpack(config) {
config.devServer
.port(8089)
.open(true)
.disableHostCheck(true)
config.when(process.env.NODE_ENV !== 'development', config => {
config
.plugin('gzip')
.use(CompressionWebpackPlugin, [{
algorithm: 'gzip',
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
threshold: 8192,
minRatio: 0.8,
cache: true
}])
})
}
}
根据speed-measure-webpack-plugin的配置,所有的插件都被wrapped了,但是如果使用webpack-chain,是不是可以不用这个插件呢?
最佳答案
关于javascript - 在vue.config.js中使用webpack-chain做webpack配置,那么speed-measure-webpack-plugin插件如何使用呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61380714/