Angular-cli: A small issue in SCSS integration section of the readme doc

Created on 8 Aug 2016  路  8Comments  路  Source: angular/angular-cli

There is a small issue In the SCSS integration section of the readme doc

After running ng set defaults.styleExt scss and installing node-sass, I've changed styleUrls to styleUrls: ['app.component.scss'], but it did not work.

Changing it to styleUrls: ['app.component.css'] worked.

image

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Ubuntu 16.04
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.10
    node: 6.3.1
    os: linux x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    N/A
  4. The log given by the failure. Normally this include a stack trace and some
    more information.
    404
  5. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

RFC / discussion / question

All 8 comments

Also, it would've been nicer if the doc said install node-sass after running ng set defaults.styleExt scss. I thought the command would take care of all dependencies, too.

Interesting, this works fine for me, even without installing node-sass.

Using styleUrls: ['app.component.scss'] also works for me

@flagbug you sure you don't have node-sass installed globally?

I also had to install node-sass and set the styleExt.

@KingsDevelopment You're right, though I don't have installed node-sass globally, it seems to be pulled in as a dependency of some other package. What's interesting though is, that I don't have any external packages except for the ones that angular-cli installs by default

I can confirm both issues:

  1. without explicitly installing node-sass the SCSS files aren't compiled
  2. setting styleUrls: ['app.component.scss'] doesn't work, I need to do use the CSS extension: styleUrls: ['app.component.css']

@frapontillo @KingsDevelopment I had install node-sass, run ng set defaults.styleExt scss and set styleUrls to scss: styleUrls: ['app.component.scss']. I wonder why we're getting different results.

@WonSong the instructions in the readme now are for the webpack version. See https://github.com/angular/angular-cli#webpack-preview-release-update for upgrade instructions.

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