-
Notifications
You must be signed in to change notification settings - Fork 31
🎨 Fix afterOptimizeChunkAssets deprecation warning #23
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
ryanatlascreative
commented
Jul 11, 2021
- Remove legacy code and ran Prettier to clean the codebase. Fixes deprecation warning relating to afterOptimizeChunkAssets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor changes requested, looks good from here!
Sweet, will get on this now! |
return this._compiler.hooks.compilation.tap( | ||
CompilerEventsFacade.extensionName, | ||
(comp) => { | ||
const afterOptimizeChunkAssets = (chunks) => { | ||
call(comp, chunks); | ||
}; | ||
/* https://github.com/webpack/webpack/blob/main/lib/Compilation.js#L772-L779 | ||
afterOptimizeChunkAssets = PROCESS_ASSETS_STAGE_OPTIMIZE + 1 | ||
*/ | ||
const stage = Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE + 1; | ||
(comp.hooks as any).processAssets.tap( | ||
{ name: CompilerEventsFacade.extensionName, stage }, | ||
afterOptimizeChunkAssets, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's release this as a minor patch, and work on refactoring this to use the new processAssets
and release that as a major patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good for a minor release, let's refactor the logic in a major release soon.