Skip to content

Allow less-loader to use webpack resolver when no includePaths are given #11159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vincentjames501
Copy link
Contributor

  • 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.

Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the original intent of the otherwise unnecessary lessPathOptions variable. Somewhere along the way someone changed it to include an empty array by default. This is indeed a defect. Thank you for the fix.

Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note also that the commit message should start with fix(@angular-devkit/build-angular):

…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.
@vincentjames501 vincentjames501 force-pushed the fix-less-loader-resolver branch from bb15c80 to b727bdc Compare June 8, 2018 01:19
@vincentjames501
Copy link
Contributor Author

@clydin fixed the commit message. Thanks.

@filipesilva filipesilva merged commit dc62ecb into angular:master Jun 8, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants