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`
- Langage dominant
- JavaScript
- Étoiles
- 8.1k
- Forks
- 358
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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"
},
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start with the package.json configuration and the microbundle build command shown in the report, then compare the TypeScript 4.7 package exports guidance. Done means a CommonJS-and-ES-module package produces both dist/index.d.ts and dist/index.d.cts, with the import and require type entries resolving to the corresponding files.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, typescript
- Domaine
- build-system
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100