developit / developit/microbundle

A typescript package that supports both commonjs and esmodule should generate `.d.ts` and `.d.cts` type files, now only `.d.ts`

Offen
#1,030 8 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
TypeScript upstream
Vorherrschende Sprache
JavaScript
Sterne
8.1k
Forks
358
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

typescript 文档请参考:[https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing)

package.json
```
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default":"./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default":"./dist/index.cjs"
}
}
},
"files": [
"dist"
],
"scripts": {
"test": "npm run build && cd ./test && npm run dev",
"clean": "rimraf dist",
"build": "rimraf dist && microbundle --target node -f esm,cjs"
},
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.