-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update webpack-bundle-analyzer to ^4.1.0 #6091
Comments
@genie-youn Hi Bro,how to use smp(speed-measure-plugin) with vue-cli ? |
@IndexXuan 1. in configureWebpackvue.config.js const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
module.exports = {
configureWebpack: smp.wrap({
plugins: [
new MyAwesomeWebpackPlugin()
]
}),
//...
} 2. in chainWebpackYou must delete vue.config.js \module.exports = {
//...
chainWebpack: config => {
// *Must delete these plugins*
config.plugins.delete('preload');
config.plugins.delete('prefetch');
// GraphQL Loader
config.module
.rule('graphql')
.test(/\.graphql$/)
.use('graphql-tag/loader')
.loader('graphql-tag/loader')
.end()
// Add another loader
.use('other-loader')
.loader('other-loader')
.end()
config
.plugin('html')
.tap(args => {
return [/* new args to pass to html-webpack-plugin's constructor */]
})
const wrappedConfig = smp.wrap(config.toConfig());
config.toConfig = () => wrappedConfig;
}
} 3. Modify vue-cli source in your project's node_modulesSome plugins that appended by vue-cli, (e.g. webpack-bundle-analyzer) So to measure the speed of these plugins, we directly modify code of vue-cli. Similarly, should delete this point at node_modules/@vue/cli-service/libs/commands/build/index.js if (args.clean) {
await fs.remove(targetDir)
}
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
webpackConfig = smp.wrap(webpackConfig);
return new Promise((resolve, reject) => {
webpack(webpackConfig, (err, stats) => { It would be great if |
@genie-youn Thanks a lot. long time to find the solution. so @sodatea , will smp be the built in function in Vue CLI, like https://umijs.org/zh-CN/docs/env-variables#speed_measure |
不用删除 preload plugin, |
但是这样好像不能测量插件的时间 |
What problem does this feature solve?
Hi teams 😄
Thanks for making awesome tool.
Into the subject..
webpack-bundle-analyzer 4.1.0 was released a few days ago: webpack-contrib/webpack-bundle-analyzer@v3.8.0...v4.1.0
In this update, the
bfj
module was replaced by a custom json writer, which resulted in many performance improvements.(ref PR)
In my case, I use a large scale Vue Application in vue-cli, and when I changed the version, the performance was greatly improved as follows.
before
after
I've seen that there is no break change between versions, so what do you think of upgrading the version of webpack-bundle-analyzer to 4.1.0?
I prepared a pull request.
Thanks you 😄
What does the proposed API look like?
Update webpack-bundle-analyzer to ^4.1.0
The text was updated successfully, but these errors were encountered: