Skip to content

🎨 Fix afterOptimizeChunkAssets deprecation warning #23

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

Merged
merged 5 commits into from
Jul 13, 2021

Conversation

ryanatlascreative
Copy link
Contributor

  • Remove legacy code and ran Prettier to clean the codebase. Fixes deprecation warning relating to afterOptimizeChunkAssets.

@ryanatlascreative ryanatlascreative added type: bug A bug. type: enhancement New feature or code enhancement. labels Jul 11, 2021
@ryanatlascreative ryanatlascreative self-assigned this Jul 11, 2021
Copy link
Member

@rushilsrivastava rushilsrivastava left a 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!

@ryanatlascreative
Copy link
Contributor Author

Just some minor changes requested, looks good from here!

Sweet, will get on this now!

Comment on lines +15 to +27
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,
Copy link
Member

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.

Copy link
Member

@rushilsrivastava rushilsrivastava left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A bug. type: enhancement New feature or code enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants