-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
feat: Added ability to adjust plugin processAssets hook stage (#262) #263
feat: Added ability to adjust plugin processAssets hook stage (#262) #263
Conversation
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.
It looks like CI is failing because it wants security updates vis-a-vis webpack version. Let me know if you want me to fix that.
README.md
Outdated
beforeEmit.tap('BatmanPlugin', (manifest) => { | ||
return { ...manifest, name: 'hello' }; | ||
}) | ||
beforeEmit.tap("BatmanPlugin", (manifest) => { |
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 from the lint commit hook.
@tomlagier thanks for opening this PR. I'm good with the concept with one caveat: I'd like to rename the option to |
4338db4
to
a93ca8c
Compare
Sounds good, will get those updates in today. |
3abf43a
to
300000b
Compare
Updated the PR, but I was having some lint & TS errors in untouched files. |
That's strange. Just checked master and it's looking OK. |
300000b
to
ba07ca9
Compare
This https://github.com/shellscape/webpack-manifest-plugin/runs/4777081149?check_suite_focus=true#step:11:92 is why CI was failing. I'll clean this up and push to your branch so this can be merged. |
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers: #262
Description
This PR adds the ability to modify the
processAssets
stage that theWebpackManifestPlugin
runs under. Currently, it is hard-coded toInfinity
, which means that it will always run last in theprocessAssets
stack. If we want to do some async behavior based on the output of the manifest, we need to schedule a hook later in theprocessAssets
series.This allows us to manually modify the stage the hook runs at by passing a
processAssetsStage
option. We can set it to, e.g.webpack.Compiler.PROCESS_ASSETS_STAGE_ANALYSE
and then add our own plugin atPROCESS_ASSETS_STAGE_REPORT
.