size-limit
size-limit copied to clipboard
--why and custom webpack config
We need a docs with Webpack Bundle Analyzer or hack in index.js to add plugin automatically.
Wondering if this is the same issue:
When we create a custom config, --why appears to be ignored.
Yeap, we do not have good UI explain that we do not support --why for custom configs.
Just use Webpack Bundle Analyzer manually.
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?
You need two configs. One you will use to build app and in Size Limit. The second will use Webpack Bundle Analyzer.
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.
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
Is there any chance to support --why on create-react-app?
You can try manually add Webpack Bundle Analyzer to CRA
Not really. You can't edit CRA config
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.