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`
- 主要言語
- JavaScript
- スター
- 8.1k
- フォーク
- 358
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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"
},
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- build-system
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100