-
-
Notifications
You must be signed in to change notification settings - Fork 607
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: shareable webpack configs using extends
#3738
feat: shareable webpack configs using extends
#3738
Conversation
Before continuing further work. A couple of questions
@alexander-akait @snitin315 Need your insights on this. Thank you |
I think merge it in each other, you can have
We can prevent it to keepind array of merged and if it developer has a loop throw an error |
I added a few tests cases in #2868. I feel those should be covered. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #3738 +/- ##
==========================================
+ Coverage 91.46% 91.64% +0.17%
==========================================
Files 22 22
Lines 1581 1627 +46
Branches 444 460 +16
==========================================
+ Hits 1446 1491 +45
- Misses 135 136 +1
Continue to review full report in Codecov by Sentry.
|
Got it. Most of the implementation is done, just need to handle the part where an extended config has its own |
|
||
config.options[index] = merge(extendedConfig, configOptions); | ||
} | ||
} |
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.
Please move it to own function and just use && { extend: string[] }
to avoid ts-except-error
extends
extends
All checks have passed |
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.
Thank you, looks good, I will test it soon (maybe add a little bit more tests) and we will merge, thank you
While refactoring found bugs... It should work now as expected, also allows to load configurations on any depth + catch recusive calls + setup valid cache keys for invalidation, small tweaks. But yeah we need more tests here:
In theory we can add even more tests, but I think it is enough for basic testing |
So if somebody have time feel free to add such tests cases |
Do we add them in the same PR or can we add them separately? |
We need to ad them here |
@burhanuday Would you be willing to send a PR to add this feature to the CLI docs here? |
@snitin315 yup. Will do |
@snitin315 @alexander-akait can we do a release for webpack-cli before webpack release with the type changes get published tomorrow |
@burhanuday better to do it after webpack release, otherwise we will have types problems, release will be tomorrow, so I will do webpack-cli release tomorrow too |
What kind of change does this PR introduce?
feature
Adds
--extends
option to the CLI as well as support forextends
in webpack configThis PR builds on top of #2868
Instead of having to update webpack, this takes the approach of modifying the config before webpack is run
Did you add tests for your changes?
yes
If relevant, did you update the documentation?
no
Summary
Closes #2748
Does this PR introduce a breaking change?
Other information