mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 04:26:01 +08:00
refactor(@angular-devkit/build-angular): clean externalMetadata arrays on every rebuild
Currently, externalMetadata arrays get appended the same items over and over again on every rebuild. This commit cleans the array before it appending the new values.
This commit is contained in:
parent
988dce6eff
commit
ef2437fe95
@ -184,6 +184,11 @@ export async function* serveWithVite(
|
||||
// To avoid disconnecting the array objects from the option, these arrays need to be mutated instead of replaced.
|
||||
if (result.externalMetadata) {
|
||||
const { implicitBrowser, implicitServer, explicit } = result.externalMetadata;
|
||||
// Empty Arrays to avoid growing unlimited with every re-build.
|
||||
externalMetadata.explicit.length = 0;
|
||||
externalMetadata.implicitServer.length = 0;
|
||||
externalMetadata.implicitBrowser.length = 0;
|
||||
|
||||
externalMetadata.explicit.push(...explicit);
|
||||
externalMetadata.implicitServer.push(...implicitServer);
|
||||
externalMetadata.implicitBrowser.push(...implicitBrowser);
|
||||
|
Loading…
x
Reference in New Issue
Block a user