-
-
Notifications
You must be signed in to change notification settings - Fork 56
fix: 🐛 use proper webpack hook #236
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
base: master
Are you sure you want to change the base?
Conversation
|
@austinw-fineart Tnx for the PR, I'll take a look soon! |
85d3493 to
44fc78e
Compare
|
Made an error with the webpack types so I ended up reusing the stringified contents for RawSource, which means I ended up not using the file utils. |
Refactors the webpack plugin to use the proper hook, only extracting keys from processed files. Also avoids triggering compilation twice in watch mode.
44fc78e to
b3efb94
Compare
|
Ideally being able to reference the webpack types would be preferrable but that'd take a dev or peer dependency so it's understandable. |
|
@austinw-fineart I'm unfamiliar with testing such plugins, but I want to ensure that regressions are introduced. How did you test it? |
|
I used my own project to test with. I could add a stripped down version here but it wouldn't exactly match your existing tests. It'll require a dependency on @angular-builders/custom-webpack to run however. |
|
There is a breaking change if you consider that before the plugin would run extract on the entire project initially, but doing so triggers a second compilation in watch mode. Now the plugin only extracts keys from modified files which makes it more suited as a watch companion rather than a build step which the CLI can fulfill. It's still possible to scan the entire project manually on the first pass but I'm not sure if that's worth the tradeoff. |
|
@austinw-fineart What's the tradeoff here? Did you feel any big impact when using the plugin as is? The extraction should be pretty quick. Can you share the considerations and metrics (if some were collected)? |
|
I wouldn't know how to do any synthetic benchmarks but here are my numbers from a large size project:
² second compilation triggered immediately after by the file watcher |
Refactors the webpack plugin to use the proper hook, only extracting keys from processed files. Also avoids triggering compilation twice in watch mode.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information