Make two files instead of three
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- build-system, tooling
調査の方向性
issue に示されている factor-bundle コマンドから始め、lib.js、main.js、checkout.js を使って再現します。コマンドが共有バンドルとエントリーバンドルをどのように処理するかを追跡します。完了の条件は、./main を必要とせず、junk.js も生成せずに、要求されたサイト用バンドルと checkout バンドルを生成することです。
索引モデルが issue の本文から書いたものです。
説明
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 :)
- 主要言語
- JavaScript
- スター
- 397
- フォーク
- 24
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
browserify/factor-bundle のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
browserify/factor-bundle#95 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
browserify/factor-bundle#94 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
browserify/factor-bundle#92 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
browserify/factor-bundle#83 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
browserify/factor-bundle#82 · リアクション 3 件 ·
browserify/factor-bundle の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
antfu-collective/icones#398 ·
-
ECmail.com オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
wesbos/burner-email-providers#554 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
components-web-app/docs#92 ·