I attempted using the webpack-bundle-size-analyzer
package but it doesn't seem to work. Is there an easy way to output the sizes of the included packages in a webpack project?
Alternatively if there's a way to output the size of package.json packages with NPM that would be cool as well.
Have you tried to put the run script inside package.json
? It worked after I put it inside package.json like so:
...
"scripts": {
...
"analyzer": "webpack --json | webpack-bundle-size-analyzer"
}
...
then in the shell do npm run analyzer
If you need to investigate the size of packages individually, you can use this tool - https://cost-of-modules.herokuapp.com
It'll tell you what the peformance characteristics (min, min +gzipped) of any npm package would be if you were to add it to your bundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With