Skip to content

Commit

Permalink
fix(@angular/cli): correct CSS import fallback logic
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed Feb 7, 2018
1 parent 4a745c9 commit fa175d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 4 additions & 5 deletions packages/@angular/cli/models/webpack-configs/styles.ts
Expand Up @@ -72,14 +72,13 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
loader.resolve(context, url, (err: Error, result: string) => {
if (err) {
reject(err);
return;
} else {
resolve(result);
}

resolve(result);
});
} else {
resolve(result);
}

resolve(result);
});
});
},
Expand Down
11 changes: 10 additions & 1 deletion tests/e2e/tests/build/styles/material-import.ts
Expand Up @@ -29,7 +29,16 @@ export default function () {
.then(() => replaceInFile('src/app/app.component.ts',
'./app.component.css', `./app.component.${ext}`))
// run build app
.then(() => ng('build', '--extract-css', '--sourcemap'));
.then(() => ng('build', '--extract-css', '--sourcemap'))
.then(() => writeMultipleFiles({
[`src/styles.${ext}`]: stripIndents`
@import "@angular/material/prebuilt-themes/indigo-pink.css";
`,
[`src/app/app.component.${ext}`]: stripIndents`
@import "@angular/material/prebuilt-themes/indigo-pink.css";
`,
}))
.then(() => ng('build', '--extract-css'));
});
});

Expand Down

0 comments on commit fa175d8

Please sign in to comment.