Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chunks/excludeChunks can match compilation.chunkNames #2735

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

jeffposnick
Copy link
Contributor

R: @developit @philipwalton @housseindjirdeh

Fixes #2717

workbox-webpack-plugin provides a way of allow/denylisting the assets in its precache manifest based on chunk names.

When making changes to the webpack plugin for the last major release, we started looking at the compilation.namedChunkGroups property to check for matches in chunks/excludeChunks. This neglects the fact that developers might also expect the names they provide to match against compilation.namedChunks (i.e. the actual chunk names, not the group names).

The code in this PR will still give preference to a match in compilation.namedChunkGroups (so it should be backwards-compatible), but for situations in which there's no match, it will fall back to checking compilation.namedChunks.

Copy link

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full disclosure: I have barely used Webpack 5 yet.

This approach seems reasonable to me. It's easier to understand than having exclude/include match both chunks and groups even when there are collisions.

@jeffposnick
Copy link
Contributor Author

Thanks for taking the time to look at this, @developit!

@jeffposnick jeffposnick merged commit 590d126 into v6 Jan 27, 2021
@jeffposnick jeffposnick deleted the chunk-names-fix branch January 27, 2021 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants