Angular-cli: stylePreprocessorOptions difficulty or bug

Created on 23 Mar 2017  路  2Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0-rc.2
node: 6.10.0
os: darwin x64
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 2.4.10

Repro steps.

.angular-cli.json

  "apps": [{
    "root": "src",
      "stylePreprocessorOptions": {
        "includePaths": [
           "assets/styles/_my-vars.scss"
        ]
      },

on somecomponent .sass or .scss

@ import "my-vars"

The log given by the failure.

ERROR in ./src/app/shared/somecomponent.component.sass
Module build failed:
@import "my-vars.scss"
^
      File to import not found or unreadable: my-vars.scss.
Parent style sheet: stdin

Desired functionality.

I would like to have sass variables and mixins globally

Mention any other details that might be useful.

I have attempted many variation of the path such as:

"/assets/styles/_my-vars.scss"
"./assets/styles/_my-vars.scss"
"src/assets/styles/_my-vars.scss"
"/src/assets/styles/_my-vars.scss"
"./src/assets/styles/_my-vars.scss"

And the compilation is successful when using a relative path

Most helpful comment

Ups, found my confusion.

I was confusing paths with files.

The correct config:

"includePaths": [
   "assets/styles"
 ]

All 2 comments

Ups, found my confusion.

I was confusing paths with files.

The correct config:

"includePaths": [
   "assets/styles"
 ]

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

purushottamjha picture purushottamjha  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

rwillmer picture rwillmer  路  3Comments