browserify / browserify/factor-bundle

Any way to apply the `common.js` to one of the entry files?

オープン
#95 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
397
フォーク
24
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm using Factor-Bundle with Browserify to generate multiple partial bundles and a larger `common.js` file with all of the common requirements. However, one of the partial bundles corresponds to my main entrypoint, `main.js` which I would actually like to contain all of `common.js` so that I have one main file with all the common JS *and* the main contents of my app, and then the other partial bundles correspond to sub-apps.

To clarify, I am trying to go from these entry points:
- `main.js`
- `sub-app1.js`
- `sub-app2.js`

to this:

- `main.js` (INCLUDING ALL COMMON REQUIREMENTS)
- `sub-app1.js` (only code and require()s unique to sub-app1)
- `sub-app2.js` (only code and require()s unique to sub-app2)

But Factor-Bundle gives me:

- `common.js` // <- can I merge this with main.js somehow???
- `main.js`
- `sub-app1.js` //good
- `sub-app2.js` //good

Unless there's some hidden option in Browserify or Factor-Bundle to generate them how I want, my next guess is there might be some Browserify function that would simply let me merge two generated packages back into one? I can't simply `browserify.bundle(common.js, main.js)` after the fact because those bundled files are in different locations and I get errors that it can't locate the relative file paths anymore.

Any ideas?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、エントリーファイル main.js、sub-app1.js、sub-app2.js に対する Factor-Bundle と Browserify のバンドリング動作を読み、common.js がどのように出力されるかに注目してください。生成済みファイルを再バンドルせずに要求された出力をサポートできるかどうかを判断してください。完了条件は、main.js に共通の requirements が含まれ、サブアプリのバンドルにはそれぞれ固有のコードだけが残ることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
build-system, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。