Make two files instead of three
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
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Bắt đầu với lệnh factor-bundle được nêu trong issue và tái hiện lệnh đó bằng lib.js, main.js và checkout.js. Theo dõi cách lệnh xử lý các bundle dùng chung và bundle entry; hoàn tất khi tạo được các bundle site và checkout theo yêu cầu mà không cần ./main hoặc tạo ra junk.js.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey!
I effectively want to split out part of a file, instead of splitting out the common parts of two files.
Currently I have bundle.js, which contains everything used on the site. There is some checkout specific logic there that I only want on the checkout, so I want to split that stuff out into bundle-checkout.js, but then run both bundle.js and bundle-checkout.js in the checkout.
With factor-bundle by default, I would be running these files on the main site:
- bundle-common.js
- bundle.js
And these on the checkout:
- bundle-common.js
- bundle.js
- bundle-checkout.js
It's pointless for me to have both bundle-common.js and bundle.js!
The best solution I've found so far is to add require('./main') to the top of the input bundle-checkout.js, which would mean that bundle.js is effectively an empty file and I can include bundle-common.js by itself, but then that generates a junk file.
lib.js:
module.exports = 'lib';
main.js:
var lib = require('./lib');
console.log(lib);
checkout.js:
require('./main');
console.log('special checkout logic');
And then the command:
browserify main.js checkout.js -p [ factor-bundle -o junk.js -o bundle-checkout.js ] -o bundle.js
Is there any way to do this without the require('./main') and the useless junk.js file?
Thanks, and sorry for the long question! I'll turn this into an article once it's been figured out so that nobody asks it again :)
- Ngôn ngữ chính
- JavaScript
- Star
- 397
- Fork
- 24
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của browserify/factor-bundle
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
browserify/factor-bundle#95 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
browserify/factor-bundle#94 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
browserify/factor-bundle#92 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
browserify/factor-bundle#83 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
browserify/factor-bundle#82 · 3 reaction ·
Tất cả issue của browserify/factor-bundle
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100