developit / developit/microbundle

Add support to generate package.json during build?

Đang mở
#297 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
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

Mô tả

Lerna [recently added](https://github.com/lerna/lerna/tree/master/commands/publish#--contents) support for the `--contents` argument.

Basically, it makes it possible to tell Lerna to publish to npm just the content of the `dist` folder (used as root directory rather than subfolder).

This means that if you have:

```
dist/
index.es.js
index.umd.js
src/
index.es.js
index.umd.js
package.json
```

it will push to npm just the content of `dist` and you'll be able to import stuff form the package with `import umd from 'pkgname/index.umd.js'`

The only missing piece is a way to generate a compatible package.json file that must be put inside the `dist` folder during the build process.

That means that the `main` (and other) field should be changed from `dist/index.js` to `index.js`.

Do you think this is something that Rollup could handle? If so I'd like to work on a PR to add it.

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

Đánh giá

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

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.