fix: support top multi compiler options#2874
Merged
alexander-akait merged 3 commits intomasterfrom Aug 5, 2021
Merged
Conversation
snitin315
reviewed
Aug 4, 2021
| const evaluatedConfigs = await Promise.all( | ||
| options.config.map(async (value) => | ||
| evaluateConfig(await loadConfig(path.resolve(value)), options.argv || {}), | ||
| const loadedConfig = await Promise.all( |
Member
There was a problem hiding this comment.
Suggested change
| const loadedConfig = await Promise.all( | |
| const loadedConfigs = await Promise.all( |
| loadedConfig.forEach((loadedConfig) => { | ||
| const isArray = Array.isArray(loadedConfig.options); | ||
|
|
||
| // TODO we should run webpack multiple times when the `--config` options has multiple values without `--merge`, need to solve for the next major release |
Member
There was a problem hiding this comment.
Suggested change
| // TODO we should run webpack multiple times when the `--config` options has multiple values without `--merge`, need to solve for the next major release | |
| // TODO we should run webpack multiple times when the `--config` options have multiple values with `--merge`, need to solve for the next major release |
| evaluatedConfig.options.forEach((options) => { | ||
| config.options.push(options); | ||
| config.path.set(options, evaluatedConfig.path); | ||
| loadedConfig.forEach((loadedConfig) => { |
Member
There was a problem hiding this comment.
Suggested change
| loadedConfig.forEach((loadedConfig) => { | |
| loadedConfigs.forEach((loadedConfig) => { |
Codecov Report
@@ Coverage Diff @@
## master #2874 +/- ##
==========================================
- Coverage 95.01% 94.95% -0.07%
==========================================
Files 31 31
Lines 1706 1704 -2
Branches 498 484 -14
==========================================
- Hits 1621 1618 -3
- Misses 85 86 +1
Continue to review full report at Codecov.
|
Member
Author
|
/cc @webpack/cli-team need review |
anshumanv
reviewed
Aug 4, 2021
| async loadConfig(configPath, argv = {}) { | ||
| const { interpret } = this.utils; | ||
| const ext = path.extname(configPath); | ||
| const interpreted = Object.keys(interpret.jsVariants).find((variant) => variant === ext); |
Member
There was a problem hiding this comment.
can just use interpret.jsVariants[ext] ?
Member
There was a problem hiding this comment.
oh it is existing logic, maybe we can improve it late
anshumanv
approved these changes
Aug 4, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
yes
If relevant, did you update the documentation?
No
Summary
fixes #2873
Does this PR introduce a breaking change?
No
Other information
We should refactor our logic for multiple
--config, ideally I think we should runmergewhen multiple configurations provided, but it is breaking change and should be solved for the next major release