@wordpress/scripts: Support path-based chunk names in FixStyleWebpackPlugin #32834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #32791.
Description
Changes FixStyleWebpackPlugin's chunk name to
styleFile
name resolution to account for chunk names which might contain forward slashes. This gives users overridingwebpack.config.js
the option of using path-based entry names by settingoptimization.splitChunks.cacheGroups.style.name
.It's possible that the
optimization.splitChunks.cacheGroups.style.name
function could be set in@wordpress/scripts
'webpack.config.js
file as well, but I am not familiar enough withsplitChunks
or thestyle
cacheGroup
that I am comfortable asserting that my simple implementation (see the test configuration in the next section) will cover any range of edge-cases.How has this been tested?
npm run lint-js
@wordpress/scripts
'webpack.config.js
as follows:Screenshots
Types of changes
Bug fix
Checklist: