Feature proposal: Option to turn off automatic chunk naming
See original GitHub issue🚀 Feature Proposal
Add a new option to the Babel plugin to turn off automatic chunk naming.
Motivation
The Babel plugin currently does two things, add SSR support and automatically add chunk naming via a magic Webpack comments. In some cases, you might only want to add the SSR support, but not add readable names to the chunks.
For example, with Webpack’s split chunks, the chunk names will also affect the file names, and you might not want to expose the names of the chunks to the end users for various reasons (I also think having chunk names can in some cases affect how Webpack splits chunks). Even with Webpack 5s prod-default ‘deterministic’ option will still preserve these chunk names because they were added via a magic comment.
Example
new LoadablePlugin({ automaticChunkNames: false })
Pitch
There are valid cases where you don’t want automatic chunk names and this feature makes sense/can only be implemented inside of Loadable itself. It’s also a minimal API to both implement and maintain in the future, so no real downsides. This API also enables having chunk names in dev, but avoiding them in prod. Keeping the default to true
makes this a non-breaking change.
If there is interest I could probably find time to try implementing this.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6
Top GitHub Comments
Yes, this is more about implementation detail rather than a feature.
It’s still not a big problem to find a chunk name from the stats. It’s just not how it’s working right now, and it might be not that easy to change this.
From time to time I am thinking about doing a major change with some necessary API updates, and that can be a part of it. One day.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.