Add option to DependencyExtractionWebpackPlugin that allows to only run the plugin on certain entrypoints #33378
Labels
Needs Decision
Needs a decision to be actionable or relevant
[Package] Dependency Extraction Webpack Plugin
/packages/dependency-extraction-webpack-plugin
Projects
What problem does this address?
The issue that I am running into again and again ist that the DependencyExtractionWebpackPlugin applies to all entrypoints. Which means that when you use something like lodash or any of the WordPress dependencies on the frontend for example this means than the entirety of lodash is enqueued from WordPress Core. Instead I would love to get the benefits from treeshaking and also have the ability to controll the version of scritpts in these other entries.
What is your proposed solution?
The solution I'm thinking about is to either add an option to the configuration object that allows you to provide the names of the entrypoints it should be allowed to run on. Otherwise maybe a functoin that can be overridden that gets passed the entry so developers can write their own conditional.
The text was updated successfully, but these errors were encountered: