Skip to content

Commit

Permalink
fix(@angular/cli): only set less-loader paths when present in config
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and Brocco committed Sep 22, 2017
1 parent 38da034 commit 515f871
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@angular/cli/models/webpack-configs/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,17 @@ export function getStylesConfig(wco: WebpackConfigOptions) {

// use includePaths from appConfig
const includePaths: string[] = [];
let lessPathOptions: { paths: string[] };

if (appConfig.stylePreprocessorOptions
&& appConfig.stylePreprocessorOptions.includePaths
&& appConfig.stylePreprocessorOptions.includePaths.length > 0
) {
appConfig.stylePreprocessorOptions.includePaths.forEach((includePath: string) =>
includePaths.push(path.resolve(appRoot, includePath)));
lessPathOptions = {
paths: includePaths,
};
}

// process global styles
Expand Down Expand Up @@ -136,7 +140,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
loader: 'less-loader',
options: {
sourceMap: cssSourceMap,
paths: includePaths
...lessPathOptions,
}
}]
},
Expand Down

0 comments on commit 515f871

Please sign in to comment.