I created new angular project with sass, and I created folder with name sass which contain a file named _variables.scss,
in app component I tried to import variables like this.
@import 'variables'
when I run ng serve i get the following error:
./src/app/app.component.scss Module build failed:
@import 'variables'
^
File to import not found or unreadable: variables.
in C:\Users\Bonge\Documents\Projects\movies_database\movies-client\src\app\app.component.scss (line 1, column 1)
Note I added the following to angular.json:
"stylePreprocessorOptions": { "includePaths": [ "src/", "src/sass/" ]
Directory structure just a angular starter app:
|- src/
|- sass/
|- _variables.scss
|- _mixins.scss
|- styles.scss
still i get the same error: what am I doing wrong here? any help
src/styles.css
tosrc/styles.scss
and in that file include the other styles in yoursrc/sass
directory. If you like check out this GitHub project of mine in which I do what you are trying to do now. Notice that in theangular.json
file a i set"styles": [ "src/styles.scss" ],
– Unexpected