-
Notifications
You must be signed in to change notification settings - Fork 373
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: config normalize after build #4972
Conversation
|
@10Derozan Please review this PR ❤️ |
OK, I get it. In fact, I hope we can change the config by In your case, you can remove This feature will break the behaviour about the beforeBuild params. It doesn't disrupt existing functionality, but the params are ambiguous.What do you think? @targeral |
Hi, thank you for your reply. I want to use a plugin to unify all my configuration changes, because I may not use it in my project repository. It may be different from the existing logic, because the existing logic will normalize before beforeBuild. |
I agree you. we need change beforeBuild to waterfall. |
In fact, we have a config hook, unfortunately, this hook was not designed to override the user's configuration file, it seems we can only add a hook to solve this problem. |
I will add a hook named |
thanks, it will also slove my problem. |
Thanks for understanding, this will not break any existing functionality.
|
I'll close this, you can raise a suggestion in #4982 |
Summary
🤖[deprecated] Generated by Copilot at 32b2dba
Refactored the build config merging and normalization process in
module-tools
to improve performance and extensibility. Changed thebeforeBuild
hook context to use the merged config array instead of the normalized config object. Updated thebuild
function inbuild.ts
to use the new config structure and validation.Details
🤖[deprecated] Generated by Copilot at 32b2dba
build
function inbuild.ts
(link, link, link, link)mergeBuildConfig
function to combine the user config and the preset config before running thebeforeBuild
hooks (link, link)normalizeBuildConfig
function after the hooks, and validate and transform it into the final config (link, link)config
property in thebeforeBuild
hook context to match the merged config structure (link)Hi.
I want to define a plugin that will clear all original config and insert some custom config.
But it dosen't work.
I look up the code and find the reason is the config only normalize before the beforeBuild hook.
It caused me to not be able to insert some custom config.
So I want to change some code that make normalize config after the beforeBuild hook.
Related Issue
Checklist
pnpm run change
.