-
Notifications
You must be signed in to change notification settings - Fork 79
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
Change worker chunk name from <ID> to <ID>.worker #60
base: master
Are you sure you want to change the base?
Conversation
Fixes GoogleChromeLabs#43, as it avoids conflicts with other number-based webpack chunks. Note that the conflict may not be on the filename (since this plugin adds '.worker' to it) but on the internal key used by webpack in referencing modules.
TBH I think I agree with your point about the cleaner fix @gluck - it'll break existing names, but perhaps that's okay? Could even append I just published |
- chunkFilename is preserved from compilerOptions - use chunkName = worker name (or ID) + '.worker' - allow to override chunkFilename is needed (GoogleChromeLabs#19)
Done, I was zealous and included suggested #19 change at the same time (because a user could use this feature to revert/customize the naming behavior), lmk if you think I should remove it. |
(note that I couldn't make it backward-compat because the check for duplicate |
I think this looks good! I'll need a little bit before I can do a proper thorough review. We'll want to think about whether this constitutes a v5 or not given the naming change. |
Fixes #43, as it avoids conflicts with other number-based webpack
chunks.
Note that the conflict may not be on the filename (since this plugin
adds '.worker' to it) but on the internal key used by webpack in
referencing modules.
E.g. in the below generated webpack loader code, using
w0
avoids conflict with chunkId0
that would otherwise never load.I'd argue that a cleaner "fix" would be to name the chunk with something like
worker.${id}
and drop the chunkFilename replacement logic (that inserts.worker.
before the output extension), but that'd break the naming of those who provided a name to the worker, so you tell me.