I've been using a different strategy lately: no explicit build process at all, just use middleware (like browserify) to automatically compile/compress/concatenate, and an HTTP cache in production to store the results (either middleware, or external such as nginx/Varnish/CloudFlare/whatever).
This helps with the principle of minimizing divergence between development and production environments.
It's worked well for me for small projects, but maybe there are issues scaling up? Has anyone else tried this approach?
One interesting possibility is make use of the Gulp ecosystem. You could imagine "gulp-middleware" that lets you use any Gulp compatible module on the fly.
Now, I sometimes need to change stuff when there are a couple thousand online visitors on one of our sites. Their requests gang up on middlewares and causes duplicate compilations. We already have reverse proxy servers to keep duplicate requests waiting for the first one but that still leaks due to different browser capabilities and stuff.
Having everything prebuilt makes more sense at this point.
You can totally use gulp plugins outside of gulp. Since they are just streams, you can do some really cool stuff. I would love to see an http wrapper so you can do wrap(req).pipe(uglify()).pipe(res)
This helps with the principle of minimizing divergence between development and production environments.
It's worked well for me for small projects, but maybe there are issues scaling up? Has anyone else tried this approach?
One interesting possibility is make use of the Gulp ecosystem. You could imagine "gulp-middleware" that lets you use any Gulp compatible module on the fly.