Skip to content

Commit 2f87390

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): correctly index and remove webpack client script in non main chunk
Closes #19219 (cherry picked from commit 661c0f2)
1 parent 76120e7 commit 2f87390

File tree

1 file changed

+4
-4
lines changed
  • packages/angular_devkit/build_angular/src/dev-server

1 file changed

+4
-4
lines changed

packages/angular_devkit/build_angular/src/dev-server/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ export function serveWebpackBrowser(
168168
continue;
169169
}
170170

171-
for (let index = 0; index < value.length; index++) {
172-
if (value[index].includes('webpack-dev-server/client/index.js')) {
173-
config.entry[key] = value.splice(index + 1, 1);
174-
}
171+
const webpackClientScriptIndex = value.findIndex(x => x.includes('webpack-dev-server/client/index.js'));
172+
if (webpackClientScriptIndex >= 0) {
173+
// Remove the webpack-dev-server/client script from array.
174+
value.splice(webpackClientScriptIndex, 1);
175175
}
176176
}
177177
}

0 commit comments

Comments
 (0)