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

Multiple entry bundles

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, rollup, typescript
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với ví dụ microbundle được liên kết và chạy microbundle -f cjs src/*.ts --no-compress, sau đó so sánh dist/c.js được tạo với đầu ra mong đợi trong issue. Được xem là hoàn tất khi giữ lại các câu lệnh require('./a')require('./b') cho các bundle có nhiều entry, đồng thời tránh phát ra các phần mở rộng .ts.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs more info question :grey_question:

Hi. I'm following the example provided here in order to bundle 3 different modules. The thing is that one of this modules requires the others, but when running microbundle -f cjs src/*.ts --no-compress the output doesn't preserve the require statements and instead bundle the dependencies inline.

I've created an example here https://github.com/nachaos/microbundle-example

Current output (using microbundle@0.13.0)

// /dist/c.js
var a = 'a';

var b = 'b';

var lib = 'lib';

var c = function c(_c) {
  return "" + a + b + _c + " - " + lib;
};

exports.c = c;
//# sourceMappingURL=c.js.map

Expected output

// /dist/c.js

var a = require('./a');

var b = require('./b');

var lib = 'lib';

var c = function c(_c) {
  return "" + a + b + _c + " - " + lib;
};

exports.c = c;
//# sourceMappingURL=c.js.map

Is there a way to configure microbundle in order to get what I expect?

Also, when trying with microbundle@0.12.3 this is the output. The require statements are preserved but with .ts file extensions, causing the usage of the module to fail.

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var a_ts = require('./a.ts');
var b = _interopDefault(require('./b.ts'));

var lib = 'lib';

var c = function c(_c) {
  return "" + a_ts.a + b + _c + " - " + lib;
};

exports.c = c;
//# sourceMappingURL=c.js.map

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.