How to find out the size of incoming packets using webpack or NPM?

I tried using the webpack-bundle-size-analyzer package, but it does not work. Is there an easy way to output the sizes of included packages in a webpack project?

Alternatively, if there is a way to infer the size of packages package.json with NPM, which will also be cool.

+7
npm webpack
source share
3 answers

Have you tried to run run script inside package.json ? It worked after I put it in package.json like this:

 ... "scripts": { ... "analyzer": "webpack --json | webpack-bundle-size-analyzer" } ... 

then in the do npm run analyzer shell

+1
source share

If you need to examine the size of packages individually, you can use this tool - https://cost-of-modules.herokuapp.com

It will tell you what performance characteristics (min, min + gzipped) of any npm package will be if you need to add it to your package.

+1
source share

Check out the Webpack Bundle Analyzer .

It represents the contents of the package as a convenient interactive scalable treemap.

0
source share

All Articles