speed-measure-webpack-plugin
speed-measure-webpack-plugin copied to clipboard
how to use this plugin in vue-cli3
you can do it like this:
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const smp = new SpeedMeasurePlugin()
module.exports = {
...,
configureWebpack: smp.wrap({
output: {
...
},
plugins: [
...
]
})
}
@AllenChinese I follow your configuration but it does not take effect
@AllenChinese I follow your configuration but it does not take effect
yeah same to me it does not take effect.
I created a new vue-cli plug-in. The main content of the plug-in is:
const origin = api.service.resolveWebpackConfig.bind(api.service);
api.service.resolveWebpackConfig = (...params) => {
const config = origin(...params);
const smp = new SpeedMeasurePlugin();
return smp.wrap(config);
};
By resetting 'api.service.resolvewebpackconfig', SMP wraps all webpack configurations