cramforce/splittable

Watchify support

maxkfranz opened this issue · 3 comments

Since this is a wrapper around Browserify, is it possible to use Watchify with it out of the box?

It would be nice to be able to

(1) use watchify in npm scripts, and

(2) have the b = browersify() instance exposed somehow in the JS API for Splittable such that I could hook up Browserify and Watchify manually in JS (as you would in a gulpfile.js).

It would be possible, but overall I think that splittable is too slow for development. It is a bit unfortunate not to have a fast mode available.

One of the slowest part about Browserify is bundling all the dependencies from node_modules. Is is possible to put all node_modules dependencies in a single dependency bundle to speed things up for development? The dep bundle would rarely if ever change.

If there are other features that are expensive (maybe tree shaking), there could be flags to turn those features off for when developing to speed things up.

Alternatively, Splittable could just extend/subclass the existing Browserify API. That way, a build process could just swap out the Splittable object with the vanilla Browserify object for fast development builds.

What do you think?