Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Not generating correct names for different output formats

未關閉
#825 6 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視

@rschristian 已經在處理了。

開始於 2021年9月15日。

  • #896 來自 @rschristian —— 未關閉

評估

難度
3/5
預估耗時
1-2 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
javascript
領域
build-system

研究方向

先從 package.json 中的欄位和 src/index.ts 進入點開始,然後使用回報的 main、exports、module、unpkg 和 types 名稱重現建置。將 dist 中產生的檔案與設定的名稱進行比較,並檢查連結的 pull request 以了解目前的方向。完成表示每種輸出格式都使用其設定的檔案名稱。

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

描述

I'm trying out Microbundle with https://github.com/reduxjs/redux-toolkit . For some reason, Microbundle seems to be ignoring the names that I've specified in the various main/module/exports fields, and is trying to reuse the the name from main for all output files.

Here's what I'm seeing. Currently, I've got package.json configured with these file names:

  "source": "src/index.ts",
  "main": "dist/a.js",   
  "exports": "./dist/b.modern.js",
  "module": "dist/c.module.js", 
  "unpkg": "dist/d.umd.js",   
  "types": "dist/typings.d.ts",

Microbundle reports this output:

Build "toolkit" to dist:
      7.22 kB: a.js.gz
      6.45 kB: a.js.br
      6.06 kB: a.modern.js.gz
      5.42 kB: a.modern.js.br
      7.14 kB: a.module.js.gz
      6.39 kB: a.module.js.br
      7.31 kB: a.umd.js.gz
      6.53 kB: a.umd.js.br

And the output files are:

dist/a.js
dist/a.modern.js
dist/a.module.js
dist/a.umd.js

Those are clearly not the file names I specified. Is there something obvious I'm missing here?

主要語言
JavaScript
星號
8.1k
分支
358
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

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

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

developit/microbundle 的其他 Issue

查看 developit/microbundle 的全部 Issue

相似的 Issue

更多 JavaScript Issue

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

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