[Question] How to specify different formats for multiple exports?
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
- Issue 類型
- 文件
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- javascript, typescript
- 領域
- build-system, tooling
研究方向
該 issue 沒有指出 repository 中的檔案或測試,但包含 package.json exports 範例和 microbundle 指令。首先查看文件中記錄的單一 export 和多個 export 範例;完成的標準是釐清是否支援按 export 設定 format 對應,並記錄適用的設定或限制。
由索引模型根據 Issue 內容生成。
描述
I'm trying to setup microbundle to provide separate exports for several modules my package is exporting, like this:
{
"name": "x",
"type": "module",
"version": "10.0",
"author": "y",
"license": "MIT",
"devDependencies": {
"microbundle": "^0.15.0",
"np": "^7.6.1",
"typescript": "^4.6.4"
},
"dependencies": {},
"scripts": {
"prepare": "microbundle ./src/one.ts ./src/two.ts"
},
"exports": {
"one": "./dist/one.modern.js",
"two": "./dist/two.modern.js"
},
"files": [
"dist"
],
"types": "dist/index.d.ts"
}
However, I don't know how to specify different export formats for each one of my exports.
The documentations provides either this example, which shows how to proceed when doing "single" exports:
"exports": {
"require": "./dist/foo.cjs",
"default": "./dist/foo.modern.js"
},
or this example, which shows an example of multiple exports, but in a single format:
"exports": {
".": "./dist/foo.modern.mjs",
"./lite": "./dist/lite.modern.mjs",
"./full": "./dist/full.modern.mjs"
},
How could I specify multiple formats like in the 1st example, while still specifying multiple named exports like in the 2nd example?
- 主要語言
- JavaScript
- 星號
- 8.1k
- 分支
- 358
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
developit/microbundle 的其他 Issue
-
CSS
難度 2/5 1-3 小時 新手友好度 68/100
developit/microbundle#1002 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
developit/microbundle#789 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 55/100
developit/microbundle#1100 · 4 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
developit/microbundle#1094 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 45/100
developit/microbundle#1093 · 3 則留言 · 1 個 reaction ·
查看 developit/microbundle 的全部 Issue
相似的 Issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 70/100
georgestephanis/p2026#40 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·