browserify / factor-bundle

factor browser-pack bundles into common shared bundles
Other
400 stars 27 forks source link

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

Open calculuschild opened 2 years ago

calculuschild commented 2 years ago

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:

to this:

But Factor-Bundle gives me:

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?