Skip to content

Commit 941f868

Browse files
clydinBrocco
authored andcommittedSep 22, 2017
fix(@angular/cli): only set less-loader paths when present in config
1 parent b90825c commit 941f868

File tree

1 file changed

+5
-1
lines changed
  • packages/@angular/cli/models/webpack-configs

1 file changed

+5
-1
lines changed
 

‎packages/@angular/cli/models/webpack-configs/styles.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
9797

9898
// use includePaths from appConfig
9999
const includePaths: string[] = [];
100+
let lessPathOptions: { paths: string[] };
100101

101102
if (appConfig.stylePreprocessorOptions
102103
&& appConfig.stylePreprocessorOptions.includePaths
103104
&& appConfig.stylePreprocessorOptions.includePaths.length > 0
104105
) {
105106
appConfig.stylePreprocessorOptions.includePaths.forEach((includePath: string) =>
106107
includePaths.push(path.resolve(appRoot, includePath)));
108+
lessPathOptions = {
109+
paths: includePaths,
110+
};
107111
}
108112

109113
// process global styles
@@ -136,7 +140,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
136140
loader: 'less-loader',
137141
options: {
138142
sourceMap: cssSourceMap,
139-
paths: includePaths
143+
...lessPathOptions,
140144
}
141145
}]
142146
},

0 commit comments

Comments
 (0)
Please sign in to comment.