Adding `includePaths` in the `stylePreprocessorOptions` seems to have no effect
See original GitHub issue- bug report
Description
Adding includePaths
in the stylePreprocessorOptions
entry in angular-cli.json
’s apps
object seems to have no effect.
Versions.
@angular/cli: 1.0.0
node: 6.10.0
os: linux x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1
@angular/language-service: 4.0.1
Repro steps.
- ng new new-project --style=scss
- cd new-project
- create new
_variables.scss
insrc/styles
- add the following to
src/styles/_variables.scss
:
$some-variable: #fff;
- add the following to
src/app/app.component.scss
:
@import 'variables';
h1 {
color: $some-variable;
}
- add the following to
.angular-cli.json
’sapps
property:
"stylePreprocessorOptions": {
"includePaths": [
"styles"
]
},
- run
ng serve
The error log
ERROR in ./src/app/app.component.scss
Module build failed:
@import 'variables';
^
File to import not found or unreadable: variables.
Parent style sheet: stdin
in ~/PROJECTS/new-project/src/app/app.component.scss (line 1, column 1)
@ ./src/app/app.component.ts 56:17-48
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
Desired functionality
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:21 (4 by maintainers)
Top Results From Across the Web
stylePreprocessorOptions angular 8 - Stack Overflow
I found same bug when started new app with Angular 8. It says "Can't find stylesheet to import." even for properly declared imports....
Read more >angular/angular-cli - Gitter
includePaths in my angular.json, but removing it made no difference. ... Data path "" should NOT have additional properties(stylePreprocessorOptions).
Read more >SASS "includePaths" in angular.json is not recognized when ...
I have an Angular monorepo project. I've set projects.public.architect.build.options.stylePreprocessorOptions.includePaths to be ["projects/public/src/ ...
Read more >Two simple configuration options for your Angular app to ease ...
Go into your tsconfig.json file. In the compilerOptions section add a paths setting. It will be an object which keys are path aliases...
Read more >Angular Workspaces: Multi-Application Projects - OctoPerf
How to create an Angular 8 project with multiple applications and libraries? This guide uses the Kraken Load Testing IDE front as an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh! So even when setting includePaths we have to import the files anyway? So the only purpose for includePath is to write “variables” instead of “…/…/…/styles/variables” ?
I’m having this issue as well, heres my the relevant part in angular-cli.json: