Skip to content

[FEATURE] Add field "preferDev" to package.json #1337

Closed
@Ginden

Description

@Ginden

What / Why

Certain packages are used almost exclusively for development. Eg. typescript, tslint etc. It's usually a mistake to add them as normal dependencies.

I suggest to add field "preferDev": boolean (with default false) to package.json. User can't install preferDev package without specyfing --production flag.

When

  • On adding new package

Where

  • npm/cli

How

Current Behavior

Packages are installed as dependencies by default.

Expected Behavior

To choose:

  • Warn user about installing preferDev package as production one.
  • Ask for confirmation if installing preferDev package as production one
  • Require --production flag explicitly set to install preferDev package as production one

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancementnew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions