Skip to main content

Publishing Type Definitions

use `files` key in `package.json` to indicate which directories should be published (https://stackoverflow.com/questions/67523877/index-d-ts-file-not-published-to-npm)

e.g.

{
  "module": "dist/esm/untilted.esm.js",
  "unpkg": "dist/unpkg/untilted.js",
  "types": "dist/types/",
  "files": [
    "dist",
    "src"
  ],
}


It can be useful to be able to publish these types in custom NPM repos e.g. Gitlab