robertknight / webpack-bundle-size-analyzer

A tool for finding out what contributes to the size of Webpack bundles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

better docs

klahnakoski opened this issue · comments

The instructions on the main page do not work, please expand them to include all steps:

C:\Users\kyle\code>npm install -g webpack-bundle-size-analyzer
C:\Users\kyle\AppData\Roaming\npm\webpack-bundle-size-analyzer -> C:\Users\kyle\AppData\Roaming\npm\node_modules\webpack-bundle-size-analyzer\webpack-bundle-size-analyzer
+ webpack-bundle-size-analyzer@3.0.0
updated 1 package in 0.257s

C:\Users\kyle\code>webpack --json | webpack-bundle-size-analyzer
'webpack' is not recognized as an internal or external command,
operable program or batch file.

Maybe it is Windows? Maybe there are a number of node and npm commands that must be run first? Maybe there is an assumption about what directory I should be in?

Thank you

Hello Kyle,

The Installation docs for webpack explain how to install the webpack CLI command.

If you have installed webpack locally as they recommend, and you are in the root directory of the project you want to analyze, then the command will be node_modules/.bin/webpack --json.

If you have installed webpack globally, then the command will be just webpack --json.

I have updated the README to assume that you are using a local installation of webpack-cli, since this is what the Webpack docs recommend that you do.