Repository navigation
'includePaths' does not work with LESS #7083
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort1: easy (hours)featureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issueshelp wantedLabel noting an issue which the team is looking for contribution from the community to fixLabel noting an issue which the team is looking for contribution from the community to fix
Description
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.
- Create project with less styles
ng new [NAME] --style=less - Create
styles/variables.lessdirectory insrcfolder - Update styles config in
.angular-cli.json
"styles": [
"styles/variables.less"
],
"stylePreprocessorOptions": {
"includePaths": [
"styles"
]
},- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort1: easy (hours)featureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issueshelp wantedLabel noting an issue which the team is looking for contribution from the community to fixLabel noting an issue which the team is looking for contribution from the community to fix
Activity
grizzm0 commentedon Jul 21, 2017
It was not included as it was blocked by webpack/less-loader#75
taras-d commentedon 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 commentedon Jul 31, 2017
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 commentedon Jul 31, 2017
I could implement it.
JPeer264 commentedon Aug 10, 2017
@filipesilva shortly v
1.3.0was 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 commentedon Aug 21, 2017
@JPeer264 your PR was released in
v1.4.0-beta.0and up. We only add features to a version in-betareleases so it did not get into 1.3.feat(@angular/cli): support includePaths for less (closes angular#7083)
angular-automatic-lock-bot commentedon Sep 7, 2019
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.
feat(@angular/cli): support includePaths for less (closes angular#7083)