Skip to content

Ng generate doesn't create css files when -sw is used to create the project #10722

Closed
@judasane

Description

@judasane

Versions


Angular CLI: 6.0.0
Node: 8.10.0
OS: win32 x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0```

### Repro steps
<!--
Simple steps to reproduce this bug.
Please include: commands run, packages added, related code changes.
A link to a sample repo would help too.
-->
* ng new name-of-project -sw
* cd name-of-project
* ng generate component name-of-component

Observed behavior

CREATE src/app/name-of-component/name-of-component.component.html (36 bytes)
CREATE src/app/name-of-component/name-of-component.component.spec.ts (693 bytes)
CREATE src/app/name-of-component/name-of-component.component.ts (273 bytes)
UPDATE src/app/app.module.ts (518 bytes)

It doesn't create the css file

Desired behavior

CREATE src/app/name-of-component/name-of-component.component.spec.ts (693 bytes)
CREATE src/app/name-of-component/name-of-component.component.ts (311 bytes)
CREATE src/app/name-of-component/name-of-component.component.css (0 bytes)
UPDATE src/app/app.module.ts (518 bytes)

When I use generate component expect to get a whole new component, but this is like if i used a flag for create styles in the .ts file

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions