angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Adding `includePaths` in the `stylePreprocessorOptions` seems to have no effect

Open vmasek opened this issue 9 years ago • 21 comments

  • [X] bug report

Description

Adding includePaths in the stylePreprocessorOptions entry in angular-cli.json's apps object seems to have no effect.

Versions.

@angular/cli: 1.0.0
node: 6.10.0
os: linux x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1
@angular/language-service: 4.0.1

Repro steps.

  • ng new new-project --style=scss
  • cd new-project
  • create new _variables.scss in src/styles
  • add the following to src/styles/_variables.scss:
$some-variable: #fff;
  • add the following to src/app/app.component.scss:
@import 'variables';

h1 {
  color: $some-variable;
}
  • add the following to .angular-cli.json's apps property:
      "stylePreprocessorOptions": {
        "includePaths": [
          "styles"
        ]
      },
  • run ng serve

The error log

ERROR in ./src/app/app.component.scss
Module build failed: 
@import 'variables';
^
      File to import not found or unreadable: variables.
Parent style sheet: stdin
      in ~/PROJECTS/new-project/src/app/app.component.scss (line 1, column 1)
 @ ./src/app/app.component.ts 56:17-48
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

Desired functionality

https://github.com/angular/angular-cli/blob/5b1668f9ba39175e0f57fe23df6672ec40c3b745/docs/documentation/stories/global-styles.md

vmasek avatar Apr 02 '17 19:04 vmasek

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.