1

I have a monorepo Angular project. I want to make it easier to import variables.scss, because otherwise I have to go up multiple times.

The project structure is next

projects
-- myApp
  -- src
    -- scss
      -- _variables.scss

What I've done so far is I placed in angular.json icnludePaths

...
"myApp": {
  ...
  "root": "projects/myApp",
  "sourceRoot": "projects/myApp/src",
  "architect": {
    "build" {
      ...
      "options": {
        ...
        "stylePreprocessorOptions": {
          "includePaths": ["src/scss"]
      }
    }
    ...
  }
}

Then I specify in component's styles

@import "variables"

The PhpStorm is fine with that and shows no errors, however when I build my project there is an error that sass loader cannot resolve @import "variables"

Sergey
  • 7,184
  • 13
  • 42
  • 85

1 Answers1

0

The includePaths array takes absolute paths, so just change "src/scss" to "projects/myApp/src/scss" and it should work.

hevans900
  • 847
  • 7
  • 15