Skip to content

'includePaths' does not work with LESS #7083

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

Closed
taras-d opened this issue Jul 21, 2017 · 7 comments
Closed

'includePaths' does not work with LESS #7083

taras-d opened this issue Jul 21, 2017 · 7 comments
Assignees
Labels
effort1: easy (hours) feature Issue that requests a new feature help wanted P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@taras-d
Copy link

taras-d commented Jul 21, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.2.2
node: 6.11.0
os: linux x64

Repro steps.

  1. Create project with less styles ng new [NAME] --style=less
  2. Create styles/variables.less directory in src folder
  3. Update styles config in .angular-cli.json
"styles": [
    "styles/variables.less"
],
"stylePreprocessorOptions": {
    "includePaths": [
        "styles"
    ]
},
  1. Import variables in component styles
@import 'variables';

div {
    color: @text-color;
}

The log given by the failure.

ERROR in ./src/app/app.component.less
Module build failed:

@import 'variables';
^
Can't resolve './variables.less' in '/home/user/Desktop/ng-less/src/app'
      in /home/user/Desktop/ng-less/src/app/app.component.less (line 1, column 0)
 @ ./src/app/app.component.ts 18:17-48
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4242 ./src/main.ts

Desired functionality.

includePaths should work like less paths option

Mention any other details that might be useful.

The steps were reproduced with scss styles and it worked correctly

@grizzm0
Copy link
Contributor

grizzm0 commented Jul 21, 2017

It was not included as it was blocked by webpack-contrib/less-loader#75

@taras-d
Copy link
Author

taras-d commented Jul 22, 2017

Is there any workaround?

It becomes inconveniently to use relative imports in case of deep folder structure
(for example @import '../../../../../variables)

@filipesilva filipesilva self-assigned this Jul 31, 2017
@filipesilva filipesilva added feature Issue that requests a new feature help wanted effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jul 31, 2017
@filipesilva
Copy link
Contributor

This is not a bug but a feature request. Less support was never included in the functionality (#4003).

Now that it's possible, I'd like to integrate it. PRs are welcome, but bear in mind it should use the built-in LESS resolver and not the webpack resolver.

@JPeer264
Copy link
Contributor

I could implement it.

@JPeer264
Copy link
Contributor

@filipesilva shortly v1.3.0 was released, but it seems that the feature of #7212 is not inside of this release (I cross-checked it with the output in my local node_modules). Or are the releases not of the latest commit of the master?

@filipesilva
Copy link
Contributor

filipesilva commented Aug 21, 2017

@JPeer264 your PR was released in v1.4.0-beta.0 and up. We only add features to a version in -beta releases so it did not get into 1.3.

dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) feature Issue that requests a new feature help wanted P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

4 participants