Skip to content

[ng add]: support for dev dependencies #15409

@dirkluijk

Description

@dirkluijk

🚀 Feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [X] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

For our library, we want to provide schematics for the ng add command. However, this automatically installs our library as dependency. Shouldn't there be a way to install it to the devDependencies?

We do add our library to the devDependencies our selves (using schematics), but that results in the following warning:

Installed packages for tooling via npm.
    ✅️ Added "foo" into devDependencies
    🔍 Installing packages...
UPDATE package.json (980 bytes)
npm WARN The package foo is included as both a dev and production dependency.

Describe the solution you'd like

  • Support for an additional dev option: ng add mylib --dev.
  • Update the npmInstall() task with an additional dev: boolean argument.

This could be done in a backwards compatible way.

Alternative solution

  • Let ng add perform an npm install --no-save
  • Change the package.json ourselves

This might be breaking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions