Skip to content

Adding includePaths in the stylePreprocessorOptions seems to have no effect #5798

@vmasek

Description

@vmasek
  • 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

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort1: easy (hours)freq1: lowOnly reported by a handful of users who observe it rarelyneeds: repro stepsWe cannot reproduce the issue with the information givenseverity2: inconvenienttype: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions