-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor: update svgprep plugin for webpack 5 #1859
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
refactor: update svgprep plugin for webpack 5 #1859
Conversation
Thanks for opening this pull request!
|
It builds fine, please again let me know when this is ready for review. |
@mtrezza It is ready 👍 |
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.
Looks good! Another annoying deprecation message less is candy for the eye!
🎉 This pull request has been released in version 3.3.0-alpha.5 |
🎉 This change has been released in version 3.3.0-beta.1 |
🎉 This change has been released in version 3.3.0 |
New Pull Request Checklist
Issue Description
This PR updates the SVG Prep plugin for webpack 5 as the current version throws the following warning:
Related issue: #1859
Approach
processAssets
hook instead ofemit
.tapAsync
withtapPromise
to simplify the code withasync
/await
.compilation
process.!!name.match(/\.svg$/)
withname.endsWith('.svg')
to make it easier to understand how the array is filtered.compilation.emitAsset
instead of just putting new objects intocompilation.assets
which was the old way (pre-webpack 5) of emitting new assets.RawSource
to letwebpack-sources
handle the final format (which usually is an object withsource
andsize
properties).TODOs before merging