Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support Node conditional exports

Đang mở
#594 9 bình luận 0 reaction 1 người được giao Xem trên GitHub

@developit đang làm issue này rồi.

Từ ngày 18/12/2020.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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"
  }
}
Ngôn ngữ chính
JavaScript
Star
8.1k
Fork
358
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của developit/microbundle

Tất cả issue của developit/microbundle

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.