nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.86k stars 2.38k forks source link

[@nrwl/angular]: stylePreprocessorOptions.includePaths not working in project.json #13927

Closed theideasaler closed 1 year ago

theideasaler commented 1 year ago

Current Behavior

I created a new monorepo angular project with the latest nx-create-wrokspace CLI. In the monorepo root, I have created a styles folder with an index.scss file in it. In the apps/{project}/project.json file I have added my styles folder as one of includedPaths:

image

I tried to test the path in my app.component.scss with @import 'index'; with a simple $color variable set in my styles.index.scss. However, it seems the includePaths are not respected, and my $color variable did not work.

My app.component.scss:

@import 'index';
body span {
  color: $color;
}

My app.component.html:

<span>hello world</span>

Note: I did the exactly same configurations 2 years ago when the monorepo was still created with a angular.json file. I am not too sure if there is anything extra needs to be set for the project.json

Expected Behavior

The stylePreprocessorOptions.includePaths should be respected.

Github Repo

No response

Steps to Reproduce

  1. Create an Angular monorepo project
  2. Create a styles folder at the root
  3. Add styles into stylePreprocessorOptions.includePaths
  4. Try import the files under styles folder

Nx Report

Node : 18.12.1
   OS   : darwin x64
   npm  : 8.19.2

   nx : 15.3.0
   @nrwl/angular : 15.3.0
   @nrwl/cypress : 15.3.0
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.3.0
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.3.0
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.3.0
   @nrwl/js : 15.3.0
   @nrwl/linter : 15.3.0
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : 15.3.0
   @nrwl/workspace : 15.3.0
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @ngxs/schematics: 0.0.1-alpha.5

Failure Logs

No response

Additional Information

No response

theideasaler commented 1 year ago

My fault, it is due to the component encapsulated styling

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.