-
Notifications
You must be signed in to change notification settings - Fork 12k
ng generate component does not recognize global styles, outputs CSS file #7715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same here |
This is happening to me as well: "@angular/animations": "^4.3.6", |
I also ran into it in 1.4.0. I had a project that was initially generated to use css styles, then updated .angular-cli.json to use scss, but the ng g c command still generates .css files. |
I also ran into it in 1.4.2. |
It has happened to me as well on 1.4.2. I'm using Ubuntu 17.04 x64 if it provides any help. What I did to manage using stylus on every component was to add It's not quite pretty, but it manages to solve the issue somehow. |
Closing as a duplicate of the issues listed above. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |

### 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

file.
Should output style file specified in .angular-cli.json
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: