Skip to content

Commit 4b805c7

Browse files
sumitarorafilipesilva
authored andcommitted
fix(@angular/cli): fix empty style urls
1 parent a0e63ea commit 4b805c7

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

packages/@ngtools/webpack/src/loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function _getResourcesUrls(refactor: TypeScriptFileRefactor): string[] {
361361
const arr = <ts.ArrayLiteralExpression[]>(
362362
refactor.findAstNodes(node, ts.SyntaxKind.ArrayLiteralExpression, false));
363363
if (!arr || arr.length == 0 || arr[0].elements.length == 0) {
364-
return;
364+
return acc;
365365
}
366366

367367
arr[0].elements.forEach((element: ts.Expression) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { writeMultipleFiles } from '../../../utils/fs';
2+
import { ng } from '../../../utils/process';
3+
4+
5+
export default function () {
6+
7+
return Promise.resolve()
8+
// Write assets.
9+
.then(_ => writeMultipleFiles({
10+
'./src/app/app.component.ts': `
11+
import { Component } from '@angular/core';
12+
13+
@Component({
14+
selector: 'app-root',
15+
templateUrl: './app.component.html',
16+
styleUrls: []
17+
})
18+
export class AppComponent {
19+
title = 'app';
20+
}
21+
`
22+
}))
23+
.then(() => ng('build'));
24+
}

0 commit comments

Comments
 (0)