ForbesLindesay / browserify-middleware

express middleware for browserify, done right
http://browserify.org
MIT License
381 stars 66 forks source link

Deferred or lazy precaching #93

Open calvinmetcalf opened 8 years ago

calvinmetcalf commented 8 years ago

Ok just spent a couple hours debuging a problem that turned out to be due to this module doing exactly that it claimed it would do.

Basically since the precaching is done on require this effectively delays server start up to the point that if I had a big enough bundle it would cause my server to fail a readiness probe.

I've fixed my problem by statically compiling my libs for production but the ability to lazy precache the bundle in production so waiting for it to cache only delays that one route would be super nifty.

ForbesLindesay commented 8 years ago

set precompile to false in the options, then it will compile the bundle only when it is first requested.