Is it possible to analyze the bundle size when running npm run dev?
The production build size should be different from dev bundle size, I don't think analyzing dev bundle is useful. Why not disable minification for the production build and see what's included in the bundle?
Thanks, that was fast. How would I disable the minification?
I think I got it.
Sorry, I'm completely lost. I tried disabling various options, but no luck.
I will need more information - are you using a template from vue-cli?
Yes, the full fledged webpack template.
I was looking at this, but had no idea how to implement it.
https://github.com/robertknight/webpack-bundle-size-analyzer
Are you saying the resulting js from npm run build is 9MB?
No, the js alone is about 2 MB.
Solved it.
webpack(webpackConfig, function (err, stats) {
fs.writeFileSync('./stats.json', JSON.stringify(stats.toJson()));
...
Most helpful comment
Solved it.