Skip to content

Commit 5236924

Browse files
thepianfilipesilva
authored andcommitted
fix(@angular/cli): guard against scripts without a src attribute
If a script is inline it has no src attribute. The build should not fail on looking for CSS scripts due to inline scripts.
1 parent c86fbb7 commit 5236924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/@angular/cli/plugins/suppress-entry-chunks-webpack-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class SuppressExtractedTextChunksWebpackPlugin {
4242
compilation.plugin('html-webpack-plugin-alter-asset-tags',
4343
(htmlPluginData: any, callback: any) => {
4444
const filterFn = (tag: any) =>
45-
!(tag.tagName === 'script' && tag.attributes.src.match(/\.css$/));
45+
!(tag.tagName === 'script' && tag.attributes.src && tag.attributes.src.match(/\.css$/));
4646
htmlPluginData.head = htmlPluginData.head.filter(filterFn);
4747
htmlPluginData.body = htmlPluginData.body.filter(filterFn);
4848
callback(null, htmlPluginData);

0 commit comments

Comments
 (0)