{"_id":"vite-plugin-dts@5.1.2","bugs":{"url":"https://github.com/qmhc/unplugin-dts/issues"},"dist":{"shasum":"c204bbee1fd01036aab7721a0d0815e2b7b7f001","tarball":"http://registry-npm.ywwl.com/vite-plugin-dts/download/vite-plugin-dts-5.1.2.tgz","fileCount":8,"integrity":"sha512-1bXUz836sWq6ewEMQre3ZtNFVfZk/92DppgCCKP8tWx/NWwV2wHuXlRHb2TztHjbikPxvyAGLGu7hVh94Plwww==","signatures":[{"sig":"MEUCIEYgkVSOJDBLhmNIJx3Lwze5sX/6rownic2a8rwvNXo/AiEAy8bFZzlXSO+zXMwtxMwpJQuEGpizWVQBCTO5dsddO/Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCE60PjuwzlOCtb5Lzoof1s/1KEF6BKcb02msWgzy0z2wIgK31KkcFcBa+7V96Qhi/eDmKg8P7fx652w/mwck+p0II="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/vite-plugin-dts@5.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":5964,"size":2798,"noattachment":false,"key":"/vite-plugin-dts/-/vite-plugin-dts-5.1.2.tgz"},"main":"dist/index.cjs","name":"vite-plugin-dts","type":"module","_from":"file:/tmp/vite-plugin-dts-5.1.2.tgz","types":"dist/index.d.ts","author":{"name":"qmhc"},"module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"default":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"license":"MIT","scripts":{"build":"tsx scripts/build.ts","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s --commit-path ."},"version":"5.1.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"2f809dbb-3dda-4588-91e6-927104dce026"}},"homepage":"https://github.com/qmhc/unplugin-dts#readme","keywords":["vite","vite-plugin","ts","dts","typescript","vue","tsc","vue-tsc","volar"],"_resolved":"/tmp/vite-plugin-dts-5.1.2.tgz","_integrity":"sha512-1bXUz836sWq6ewEMQre3ZtNFVfZk/92DppgCCKP8tWx/NWwV2wHuXlRHb2TztHjbikPxvyAGLGu7hVh94Plwww==","repository":{"url":"git+https://github.com/qmhc/unplugin-dts.git","type":"git","directory":"packages/vite-plugin-dts"},"_npmVersion":"11.19.0","description":"<h1 align=\"center\">vite-plugin-dts</h1>","directories":{},"maintainers":[{"name":"qmhc","email":"rkzhang9595@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"unplugin-dts":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@microsoft/api-extractor":"^7.57.0"},"peerDependencies":{"vite":">=3","rollup":">=3","@microsoft/api-extractor":">=7"},"peerDependenciesMeta":{"vite":{"optional":true},"rollup":{"optional":true},"@microsoft/api-extractor":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vite-plugin-dts_5.1.2_1791018692974_0.2777406530900708"},"readme":"<h1 align=\"center\">vite-plugin-dts</h1>\n\n<p align=\"center\">\n(Do not recommend anymore, please use <code>unplugin-dts</code> instead)\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/vite-plugin-dts\">\n    <img src=\"https://img.shields.io/npm/v/vite-plugin-dts?color=orange&label=\" alt=\"version\" />\n  </a>\n  <a href=\"https://github.com/qmhc/vite-plugin-dts/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/npm/l/vite-plugin-dts\" alt=\"license\" />\n  </a>\n</p>\n\n## Install\n\n```sh\npnpm i -D vite-plugin-dts\n```\n\n## Usage\n\nIn `vite.config.ts`:\n\n```ts\nimport { resolve } from 'path'\nimport { defineConfig } from 'vite'\nimport dts from 'vite-plugin-dts'\n\nexport default defineConfig({\n  build: {\n    lib: {\n      entry: resolve(__dirname, 'src/index.ts'),\n      name: 'MyLib',\n      formats: ['es'],\n      fileName: 'my-lib',\n    },\n  },\n  plugins: [dts()],\n})\n```\n\nBy default, the generated declaration files are following the source structure.\n\nFortunately, with the help of [API Extractor](https://api-extractor.com/), the plugin can bundle all types into a single file. You just need to install `@microsoft/api-extractor` and set `bundleTypes: true`:\n\n```ts\nexport default defineConfig({\n  plugins: [dts({ bundleTypes: true })],\n})\n```\n\nWhen `moduleFormat` is omitted, the plugin preserves TypeScript's declaration extensions: `.ts` → `.d.ts`, `.mts` → `.d.mts`, and `.cts` → `.d.cts`, including declaration maps.\n\nDeclaration maps preserve absolute `file://` source URLs, including Windows cross-drive paths, across all output directories.\n\nWhen publishing both ESM and CommonJS, explicitly add `outDirs` entries with\n`moduleFormat: 'esm'` and `moduleFormat: 'cjs'`; Vite's JavaScript formats are not inferred.\nEach entry is bundled once and reused for both declaration formats. Configure conditional\n`exports.types` entries separately in `package.json`.\n\nIf you start with official Vite template, you should specify the `tsconfigPath`:\n\n```ts\nexport default defineConfig({\n  plugins: [dts({ tsconfigPath: './tsconfig.app.json' })],\n})\n```\n\n## Documentation\n\nFor full documentation, please refer to [unplugin-dts](../../docs/en/usage.md).\n\n## Example\n\nA real project using this plugin: [Vexip UI](https://github.com/vexip-ui/vexip-ui).\n\n## License\n\nMIT License.\n","publish_time":1791018693049,"_cnpm_publish_time":1791018693049,"dist-tags":{"beta":"5.0.0-beta.6","dev":"4.2.3-dev.2","latest":"5.1.2"}}