Skip to content

ng generate does not respect defaults.styleExt settings #7644

Closed
@onwsk8r

Description

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

Versions.

> ng --version
@angular/cli: 1.4.1
node: 6.11.3
os: linux x64
@angular/animations: 4.3.6
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.1
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6
typescript: 2.3.4
> npm --version
3.10.10

Repro steps.

After setting the default....

> ng set --global defaults.styleExt=scss
> grep styleExt ~/angular-cli.json
    "styleExt": "scss"

When I make a new project...

> ng new my_proj && cd my_proj
...
> grep styleExt ./.angular-cli.json
    "styleExt": "scss", 

I have a file called app.component.scss with the correct styleUrl in app.component.ts.

However, when I ng g component my-awesome-component, I end up with my-awesome.component.css and the equivalent styleUrl in the Typescript file.

Desired functionality.

I would like it to respect the settings in .angular-cli.json like ng new does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentseverity3: broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions