bundlesize
bundlesize copied to clipboard
bundlesize is 10x larger after npm install since v0.14.0
Do you want to request a feature or report a bug? bug
What is the current behavior? npm install --save-dev bundlesize has grown 10x larger than in 0.14.4
If the current behavior is a bug, please provide the steps to reproduce.
Compare the following versions after npm install:
Reproduce with the following script:
mkdir old
cd old
npm init -y
npm install --save-dev [email protected]
cd ..
mkdir new
cd new
npm init -y
npm install --save-dev [email protected]
cd ..
du -sh old # 2.6M
du -sh new # 39M
What is the expected behavior?
I expected the size to be similar and small, around 1 to 3 MB.
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information.
- node version 9.5.0
- npm version 5.6.0
- Operating system Windows or Linux
- bundlesize version 0.17.0
- CI you are using none
Related: #202
@styfle Do you want to tackle this?
This is because of the addition of brotli-size
(https://github.com/siddharthkp/bundlesize/pull/194), we can make this an optional dependency with a warning if it's used before installation.
@siddharthkp Let me make sure I understand your proposal.
- Move
"brotli-size": "0.0.1"
fromdependencies
tooptionalDependencies
- Put a try-catch around
require('brotli-size')
and move it insidecase 'brotli':
- in the catch,
console.warn('Missing optional dependency: brotli-size')
- in the catch,
Does that sound right? I can submit a PR if that seems correct.
Sounds perfect!
I'm assuming you are requiring brotli-size
only when the config/cli flag says so