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`

未關閉
#1,030 8 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視
TypeScript upstream
主要語言
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"
},
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

先從報告中顯示的 package.json 設定和 microbundle 建置命令開始,然後對照 TypeScript 4.7 關於套件匯出的指南。完成的標準是:CommonJS-and-ES-module 套件同時產生 dist/index.d.ts 和 dist/index.d.cts,且 import 和 require 型別項目解析至對應的檔案。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, typescript
領域
build-system
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。