Skip to content

Commit

Permalink
fix(@angular/cli): fix empty style urls
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitarora authored and filipesilva committed Jun 7, 2017
1 parent 407625c commit 18d1130
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@ngtools/webpack/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function _getResourcesUrls(refactor: TypeScriptFileRefactor): string[] {
const arr = <ts.ArrayLiteralExpression[]>(
refactor.findAstNodes(node, ts.SyntaxKind.ArrayLiteralExpression, false));
if (!arr || arr.length == 0 || arr[0].elements.length == 0) {
return;
return acc;
}

arr[0].elements.forEach((element: ts.Expression) => {
Expand Down
24 changes: 24 additions & 0 deletions tests/e2e/tests/build/styles/empty-style-urls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { writeMultipleFiles } from '../../../utils/fs';
import { ng } from '../../../utils/process';


export default function () {

return Promise.resolve()
// Write assets.
.then(_ => writeMultipleFiles({
'./src/app/app.component.ts': `
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: []
})
export class AppComponent {
title = 'app';
}
`
}))
.then(() => ng('build'));
}

0 comments on commit 18d1130

Please sign in to comment.