Feature: Override wildcards with specific settings
See original GitHub issueDo you want to request a feature or report a bug?
Feature: Allow overrides to rules specified by wildcards with more specific rules
For the configuration below I would like anything matching ./public/webpack/vendor-*.js
to have the limit of 300kb
and everything else in ./public/webpack/**/*.js
to use the limit of 150kb
.
{
"files": [
{
"path": "./public/webpack/vendor-*.js",
"maxSize": "300 kB",
"priority": 10
},
{
"path": "./public/webpack/**/*.js",
"maxSize": "150 kB"
}
]
}
What is the current behavior?
Right now ./public/webpack/vendor-*.js
would be in the results twice and fail due to the lower 150kb
limit applied to ./public/webpack/**/*.js
.
If the current behavior is a bug, please provide the steps to reproduce.
Not a bug 😉
What is the expected behavior?
The configuration would pass with only one reference to ./public/webpack/vendor-*.js
.
If this is a feature request, what is motivation or use case for changing the behavior?
Our bundle is currently much too large and we want to make it smaller. This work will take a long time and need multiple teams. While we are working to make the extremely large files smaller, we would like to enforce a more strict limit on new files. As the large files are improved, we can remove the overrides.
Please mention other relevant information.
- node version: 8.16.0
- npm version: 6.4.1
- Operating system: mac
- bundlesize version: 0.18.0
- CI you are using: Drone
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6 (2 by maintainers)
Top GitHub Comments
This has been fixed in the
beta
channel in https://github.com/siddharthkp/bundlesize/pull/324. If you aren’t using the github integration, you can start using betaHi! I just fixed this in bundlesize2
Here’s the test fixture: https://github.com/siddharthkp/bundlesize2/blob/main/cli/tests/snapshots/index.js.md#11-bug-repro-bundlesize-should-dedup-files