Closed ghostwords closed 9 years ago
I think it's better to write out something than to have missing file.
To provide some background, I have a number of source directories, each of which contains one or more entry files. I am programmatically factoring out shared modules on a per-directory basis, without knowing which directories have shared modules and which do not. It feels off to have empty common bundles hang around.
Here is my WIP build tool, if you'd like to see: https://github.com/ghostwords/chameleon/blob/3eaa2e70e0ca746ab421a199680bca873e5cc11e/tools/build.js
By the way, I just discovered that factor-bundle
doesn't yet work with watchify
, which is a real showstopper ...
I think it's better to write out something than to have missing file.
Agreed. Writing an empty file out makes the bundling process predictable, which means you can reliably put a script tag into a page for that bundle without worrying about 404s.
Should
factor-bundle
return null / not write out anything when there is nothing in common? It currently seems to return an empty bundle (when used as a plugin at least):