Skip to content

Commit b8f0c0e

Browse files
fix(@angular/build): Must respect externalDependencies
1 parent 415165e commit b8f0c0e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/angular/build/src/builders/application/execute-build.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ export async function executeBuild(
171171
// This means all paths within the @foo/bar package are also marked as external.
172172
const exclusionsPrefixes = externalConfiguration.map((exclusion) => exclusion + '/');
173173
const exclusions = new Set(externalConfiguration);
174-
const explicitExternal = new Set<string>();
175174

176175
const isExplicitExternal = (dep: string): boolean => {
177176
if (exclusions.has(dep)) {
@@ -189,23 +188,19 @@ export async function executeBuild(
189188

190189
const implicitBrowser: string[] = [];
191190
for (const dep of browser) {
192-
if (isExplicitExternal(dep)) {
193-
explicitExternal.add(dep);
194-
} else {
191+
if (!isExplicitExternal(dep)) {
195192
implicitBrowser.push(dep);
196193
}
197194
}
198195

199196
const implicitServer: string[] = [];
200197
for (const dep of server) {
201-
if (isExplicitExternal(dep)) {
202-
explicitExternal.add(dep);
203-
} else {
198+
if (!isExplicitExternal(dep)) {
204199
implicitServer.push(dep);
205200
}
206201
}
207202

208-
executionResult.setExternalMetadata(implicitBrowser, implicitServer, [...explicitExternal]);
203+
executionResult.setExternalMetadata(implicitBrowser, implicitServer, [...exclusions]);
209204
}
210205

211206
const { metafile, initialFiles, outputFiles } = bundlingResult;

0 commit comments

Comments
 (0)