browserify / factor-bundle

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

Circular dependencies in common bundle, even if unique to single entry point #69

Open Bjvanminnen opened 9 years ago

Bjvanminnen commented 9 years ago

Consider the following situation

// shared.js
console.log('hello from shared');
----------
// entry1.js
require('./shared');
----------
// entry2.js
require('./shared');
require('./one');
----------
// one.js
require('./two');
----------
// two.js
require('./three');
----------
// three.js
require('./one')

I have two entry points that share some code. One of my entry points has some code that isn't shared, but results in a circular dependency.

I would expect that the circular dependency in non-common code end up in the entry point specific output file, but instead it is ending up in the common file. If I remove the circular dependency, it ends up in the entry point specific output file (as I would expect).