Skip to content

Commit 60a16a8

Browse files
committed
fix(@angular/build): set scripts option output as classic script for karma
When using the `karma` builder, the generated output JavaScript file was unintentionally being marked as a module type script. This prevent the output file from providing equivalent behavior to that of an actual build. The `scripts` option outputs should be considered classic scripts to the browser.
1 parent ef742db commit 60a16a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/angular/build/src/builders/karma/application_builder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ class AngularPolyfillsPlugin {
161161
// page load. `type` won't affect them.
162162
continue;
163163
}
164+
if (f.pattern === 'scripts.js') {
165+
// Don't consider "scripts" option files as module types.
166+
// This should be expanded if custom scripts bundle names support is added.
167+
continue;
168+
}
164169
if (f.pattern.endsWith('.js') && 'js' === (f.type ?? 'js')) {
165170
f.type = 'module';
166171
}

0 commit comments

Comments
 (0)