angular-cli: Bug: Components are not generated with scss

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.4.1 node: 7.10.1 os: linux x64 (Bash on Ubuntu on Windows)

Repro steps.

When creating a new project:

ng new my-project --style=scss
ng g component my-component

=> create src/app/my-component/my-component.component.css (0 bytes)

Same with an existing project:

ng new my-project
ng set defaults.styleExt scss
ng g component my-component

=> create src/app/my-component/my-component.component.css (0 bytes)

Desired functionality.

The generate command should generate an .scss file instead of a .css file as mentioned in https://github.com/angular/angular-cli/issues/1177

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 26
  • Comments: 17 (5 by maintainers)

Most upvoted comments

@Karasuni verified. It is indeed a bug. @shahzadhassan10 the bug is not that scss files aren’t being generated on creating the project via ng new. The bug is that when we’re creating a component using ng generate component test-component, the style file created is not .scss, it is .css file.

They should just make scss the default. All css is valid in scss but not vice versa.

This works @angular/cli 6.0.8

{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
        "my-app": {
            "root": "",
            "sourceRoot": "src",
            "projectType": "application",
            "prefix": "app",
            "schematics": {
                "@schematics/angular:component": {
                    "styleext": "scss"
                }
            },
            ...
       }
   }
}

Duplicate of #7624