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

Support Node conditional exports

未關閉
#594 9 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

@developit 已經在處理了。

開始於 2020年12月18日。

評估

這個 Issue 還沒有評估資料。

描述

enhancement :rocket: important

In node 13, there is a new option available: exports.

As this will be the new standard for defining packages available for node/browsers/etc, it could be nice to use it instead/addition of the module, unpkg etc. fields in the current package.json. Webpack also plans to support it in the v5: https://github.com/webpack/webpack/issues/9509

Current API:

{
  "source": "src/foo.js",           // Your source file (same as 1st arg to microbundle)
  "main": "dist/foo.js",            // output path for CommonJS/Node
  "module": "dist/foo.module.js",   // output path for JS Modules
  "unpkg": "dist/foo.umd.js",       // optional, for unpkg.com
  "scripts": {
    "build": "microbundle",         // uses "source" and "main" as input and output paths by default
    "dev": "microbundle watch"
  }
}

New API:

{
  "source": "src/foo.js",           // Your source file (same as 1st arg to microbundle)
  "main": "dist/foo.js",            // output path for CommonJS/Node
  "exports": { 
    "import": "dist/foo.module.js", // output path for JS Modules
    "browser": "dist/foo.umd.js",   // optional, for unpkg.com
  },
  "scripts": {
    "build": "microbundle",         // uses "source" and "main" as input and output paths by default
    "dev": "microbundle watch"
  }
}
主要語言
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 摘要。