Skip to content

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

Closed

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

Activity

  1. clydin commented on May 8, 2018

    @clydin
    Member

    -sw is the equivalent of -s -w. -s is the short option for inline styles. -w is not actually an option and should error but currently does not. The lack of an error for -w is a defect and will be corrected.

  2. judasane commented on May 9, 2018

    @judasane
    Author

    @clydin , -sw used to be the alias for --service-worker in previous versions. like This page shows (I didn't find official documentation for version 5 because it's not shown anymore in the official page. It jumps from 4 to 6)

  3. self-assigned this
    on May 11, 2018
  4. added 4 commits that reference this issue on May 11, 2018
    ca23f77
    80f033f
    88f0efc
    85a91dc
  5. added a commit that references this issue on May 24, 2018
    a44d76a
  6. added a commit that references this issue on Jun 6, 2018
    bff13f8
  7. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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