Skip to content

ng generate component does not recognize global styles, outputs CSS file #7715

Closed
@craig-o-curtis

Description

@craig-o-curtis

screen shot 2017-09-16 at 11 16 58 am

### Bug Report or Feature Request (mark with an `x`) ``` - [x ] bug report -> please search issues before submitting - [ ] feature request ```

Versions.

macOS Sierra 10.12.6
Node v6.10.2
npm 5.4.2

@angular/cli: 1.4.2
node: 6.10.2
os: darwin x64
@angular/animations: 4.4.1
@angular/common: 4.4.1
@angular/compiler: 4.4.1
@angular/core: 4.4.1
@angular/forms: 4.4.1
@angular/http: 4.4.1
@angular/platform-browser: 4.4.1
@angular/platform-browser-dynamic: 4.4.1
@angular/router: 4.4.1
@angular/cli: 1.4.2
@angular/compiler-cli: 4.4.1
@angular/language-service: 4.4.1
typescript: 2.3.4

Repro steps.

Generate a new project:
ng g new myapp --routing --style scss

Confirm .angular-cli.json defaults > styleExt is scss

Generate a module:
ng g m main -m app --routing

Generate a component: // BUG HERE
ng g c main // outputs .css file, not .scss

Re-set styleExt with command // futile
ng set defaults.styleExt scss

Regenerate new module and component still has .css extension.

The log given by the failure.

No log from failure. The output style file is .css instead of .scss

Work-around is to specify style=scss in component generating step to correct.
ng g c main -m app --style=scss

Desired functionality.

Previous versions of Angular-CLI automatically output the correct scss or other style extension
screen shot 2017-09-16 at 11 16 49 am
file.
Should output style file specified in .angular-cli.json

Mention any other details that might be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions