maximegris/angular-electron

Files not found after adding stylePreprocessorOption to angular.json

lkuessner opened this issue · 1 comments

I wanted to get rid of those relative style imports like '../../../../styles/_colors'
Therefore I did add the following to the angular.json file:

{
   ...
  "projects": {
    "angular-electron": {
      "root": "",
       ...
      "architect": {
        "build": {
          "configurations": {
            "stylePreprocessorOptions": {
              "includePaths": ["./src/app/styles"]
            }
          }
        }
      }
    }
  }
}
projects > angular-electron > architect > build > configurations > stylePreprocessorOptions

Correct me if im wrong but this is the correct place to set this option right?

Result of this is that I can now use this way to import @use 'colors' as colors; but the editor tells me Cannot resolve file 'colors' .

The application compiles correctly and as I change the value of a variable that is defined in colors.scss, it changes accordingly.

Any idea how to fix this?

Edit:
The main idea is to get rid of those unpractical import/use statements like described here: https://www.digitalocean.com/community/tutorials/angular-shortcut-to-importing-styles-files-in-components

Hi

I think the correct path is rather projects > angular-electron > architect > build > options > stylePreprocessorOptions (same level as styles or scripts ?