Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bundlesize is 10x larger after npm install since v0.14.0 #213

Open
styfle opened this issue Apr 13, 2018 · 4 comments
Open

bundlesize is 10x larger after npm install since v0.14.0 #213

styfle opened this issue Apr 13, 2018 · 4 comments

Comments

@styfle
Copy link

styfle commented Apr 13, 2018

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 bundlesize@0.14.0
cd ..
mkdir new
cd new
npm init -y
npm install --save-dev bundlesize@0.17.0
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
@edmorley
Copy link
Contributor

Related: #202

@siddharthkp
Copy link
Owner

@styfle Do you want to tackle this?

This is because of the addition of brotli-size (#194), we can make this an optional dependency with a warning if it's used before installation.

@styfle
Copy link
Author

styfle commented Apr 13, 2018

@siddharthkp Let me make sure I understand your proposal.

  1. Move "brotli-size": "0.0.1" from dependencies to optionalDependencies
  2. Put a try-catch around require('brotli-size') and move it inside case 'brotli':
    • in the catch, console.warn('Missing optional dependency: brotli-size')

Does that sound right? I can submit a PR if that seems correct.

@siddharthkp
Copy link
Owner

siddharthkp commented Apr 13, 2018

Sounds perfect!

I'm assuming you are requiring brotli-size only when the config/cli flag says so

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants