Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

--why and custom webpack config #67

Open
ai opened this issue Jun 1, 2018 · 10 comments
Open

--why and custom webpack config #67

ai opened this issue Jun 1, 2018 · 10 comments

Comments

@ai
Copy link
Owner

ai commented Jun 1, 2018

We need a docs with Webpack Bundle Analyzer or hack in index.js to add plugin automatically.

@bcullman
Copy link

Wondering if this is the same issue:

When we create a custom config, --why appears to be ignored.

@ai
Copy link
Owner Author

ai commented Jun 29, 2019

Yeap, we do not have good UI explain that we do not support --why for custom configs.

Just use Webpack Bundle Analyzer manually.

@bcullman
Copy link

ok, then one question:

When I configure bundle analyzer manually, size-limit switches from reporting package as the gzipped value to the parsed sized value.

How can I get size-limit to report the gzipped value when using a custom Webpack Bundle Analyzer config?

@ai
Copy link
Owner Author

ai commented Jun 29, 2019

You need two configs. One you will use to build app and in Size Limit. The second will use Webpack Bundle Analyzer.

@bcullman
Copy link

bcullman commented Jun 29, 2019

The problem i am having is that size limit fails if my build include sass files. So I need a custom config for size limit. I believe I want to set...

[
  {
    config: "path/to/my/config/webpack.config.sizeLimit.js",
    gzip: true
  }
]

...but it is not honoring this value.

when I dont specify a config, the reported size in the console was the gzip size (around 45K)
when i specify a config, the reported size in the console switches to the parsed size around (around 550K)

I can see in bundle analyzer both have been computed (and are correct). I just want size-limit to continue to report in the console the gzip size.

@ai
Copy link
Owner Author

ai commented Jul 1, 2019

I have a better option for you. If you have big webpck application it will be better to use webpack: false and just call Size Limit after webpack built bundles:

https://github.com/ai/size-limit#usage-for-applications-and-big-libraries

@FezVrasta
Copy link

Is there any chance to support --why on create-react-app?

@ai
Copy link
Owner Author

ai commented Aug 16, 2019

You can try manually add Webpack Bundle Analyzer to CRA

@FezVrasta
Copy link

Not really. You can't edit CRA config

@ai
Copy link
Owner Author

ai commented Aug 16, 2019

Sorry. Seems like CRA is not the best thing. It will help if we will force CRA to more to sharec (when it will be stabilized) to be able to change configs.

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

No branches or pull requests

3 participants