Skip to main content

npm exports Builder

v1.0.0

Visual builder for the exports field — conditions, subpaths, types, default fallbacks.

package.json exports field
{
  "name": "my-package",
  "type": "module",
  "main": "./dist/index.cjs",
  "module": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "import": {
        "types": "./dist/index.d.mts",
        "default": "./dist/index.js"
      },
      "require": {
        "types": "./dist/index.d.cts",
        "default": "./dist/index.cjs"
      }
    },
    "./styles.css": "./dist/styles.css"
  },
  "files": [
    "dist/"
  ],
  "sideEffects": [
    "*.css"
  ]
}

// Verify with publint: npx publint
// Check compatibility: npx are-the-types-wrong