fix: same name chunk case

This commit is contained in:
春希 2020-04-20 14:19:33 +08:00
parent 267953b82b
commit d6855e2236

View File

@ -62,11 +62,13 @@ export default class Builder implements ICodeBuilder {
} }
unprocessedChunks.splice(indexToRemove, 1); unprocessedChunks.splice(indexToRemove, 1);
if (!unprocessedChunks.some(ch => ch.name === name)) {
unprocessedChunks.forEach( unprocessedChunks.forEach(
// remove the processed chunk from all the linkAfter arrays from the remaining chunks // remove the processed chunk from all the linkAfter arrays from the remaining chunks
ch => (ch.linkAfter = ch.linkAfter.filter(after => after !== name)), ch => (ch.linkAfter = ch.linkAfter.filter(after => after !== name)),
); );
} }
}
return resultingString.join('\n'); return resultingString.join('\n');
} }