mirror of https://github.com/webpack/webpack.git
bugfix: candiates should only be added when adding was successful
This commit is contained in:
parent
fa57ed946c
commit
33d9f7bdbf
|
|
@ -315,12 +315,13 @@ class ModuleConcatenationPlugin {
|
|||
// _tryToAdd modifies the config even if it fails
|
||||
// so make sure to only accept changes when it succeed
|
||||
const backup = currentConfiguration.snapshot();
|
||||
const impCandiates = new Set();
|
||||
const problem = this._tryToAdd(
|
||||
compilation,
|
||||
currentConfiguration,
|
||||
imp,
|
||||
possibleInners,
|
||||
candidates,
|
||||
impCandiates,
|
||||
failureCache
|
||||
);
|
||||
if (problem) {
|
||||
|
|
@ -329,6 +330,10 @@ class ModuleConcatenationPlugin {
|
|||
|
||||
// roll back
|
||||
currentConfiguration.rollback(backup);
|
||||
} else {
|
||||
for (const c of impCandiates) {
|
||||
candidates.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!currentConfiguration.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue