Skip to content

[DOCS] npm pkg delete complex key #4829

@atomiks

Description

@atomiks

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Enhancement, not another kind of Docs Enhancement.

  • This is a CLI Docs Enhancement.

Description of Problem

The docs don't mention how to delete a complex key.

I have an exports key that I need to delete before publish, but I'm not sure how (or if it's possible). I want to delete "./src/index.ts" before publish because it's only used as an entry point in the monorepo for development:

  "exports": {
    ".": {
      "import": {
        "development": "./dist/floating-ui.dom.esm.development.js",
        "production": "./dist/floating-ui.dom.esm.min.js",
        "default": "./dist/floating-ui.dom.esm.js"
      },
      "require": "./dist/floating-ui.dom.cjs"
    },
    "./package.json": "./package.json",
    "./src/index.ts": "./src/index.ts"
  },

npm pkg delete exports../src/index.ts does not work. Tried escape characters/quotes too

Potential Solution

No response

Docs URL

https://docs.npmjs.com/cli/v8/commands/npm-pkg

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions