Skip to content

Commit 910cf41

Browse files
vincentjames501filipesilva
authored andcommitted
fix(@angular-devkit/build-angular): Allow less-loader to use webpack resolver
- If you look at https://github.com/webpack-contrib/less-loader#less-resolver, it states that if you provide paths, it will use the less resolver. We should only use the less-resolver when stylePreprocessorOptions.includePaths are actually given. - This fixes issues where if in your less file you `@import "~@dependency/less-file";` it actually resolves correct and when you import something like `@import "some-local-file";` it actually recompiles when `ng build --watch` is ran.
1 parent a40053e commit 910cf41

File tree

1 file changed

+1
-1
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
158158

159159
// use includePaths from appConfig
160160
const includePaths: string[] = [];
161-
let lessPathOptions: { paths: string[] } = { paths: [] };
161+
let lessPathOptions: { paths?: string[] } = { };
162162

163163
if (buildOptions.stylePreprocessorOptions
164164
&& buildOptions.stylePreprocessorOptions.includePaths

0 commit comments

Comments
 (0)