In this section we explore how to publish your library packages to the organization’s registry.

1. Using the NPMRC token

The NPMRC token grants access to the organization’s registry. Please follow up Adding token to connect to Azure Artifacts to make sure you have configured the token correctly.

2. Pack your libraries

{
  "name": "vite-lib-demo",
  "private": true,
  "version": "1.0.0",
  "type": "module",
  // We're packing the dist folder
  "files": [
    "dist"
  ],
  "main": "./dist/vite-lib-demo.umd.cjs",
  "module": "./dist/vite-lib-demo.js",
  "exports": {
    ".": {
      "import": "./dist/my-lib.js",
      "require": "./dist/my-lib.umd.cjs"
    }
  },
  // ... Package JSON config
}

3. Publishing

After finishing the previous steps: