Z
Z
zlodiak2019-09-02 23:43:40
JavaScript
zlodiak, 2019-09-02 23:43:40

How can styles.scss be seen from any part of the application?

NX is used to combine several angular projects into one . It has a global styles.scss file. it is located in the following location in the directory tree:

apps
  appName
    src
      styles.scss
libs
  lib1
  lib2
  lib3

The problem is that the styles in styles.scss are only visible from anywhere inside the apps directory. And I would like them to be visible to any place in the libs directory too. Please advise how to do it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Semenov, 2019-09-05
@w4_alex

You need to specify the directory where you want to watch the angular project, that is, for each project you need to add settings in the angular.json file, namely add stylePreprocessorOptions:

...
"projects": {
   "app_name": {
       .....
       "architect": {
           "build": {
              ....
                 "options": {
                   ....
                    "stylePreprocessorOptions": {
                          "includePaths": ["apps/appName/src/", "apps/themes/"]
                     },
                  }
             }
         }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question