Is preprocessing static resources through middleware (using express) a good idea for production environments? From my understanding the middleware stack is run, in series, for every request. Wouldn't that mean then that preprocessing middle would regenerate a static resource (ie some_styles.less -> some_styles.css) after every request? If so, would it be better to simply preprocess through a build system such as grunt.js in advance and serve those files? I'd like the final rendering of the css and js to be concatenated to one file and minified.
Also, is it worthwhile to pre-render html from templates (such as jade) on pages with only static content? Or is that more trouble than it's worth?
The easiest way to handle CSS and JS preprocessing and minifying is through some sort of build system, be it grunt, cake, etc. It also might offer some performance benefits; at the very least, it reduces the workload for your server.
For my projects, I have tasks in my Cakefile to handle both CSS and JS. These are invoked by running the build task, and just output to a directory of static files that is set up through app.use("/res", express.static("RESDIR")).
As for pre-rendering HTML, it will offer a performance benefit. Unless doing it is very complex, I would go ahead and pre-render everything you easily can. It is far, far simpler to do it up front than to bolt it on down the road (if you're expecting any sort of growth, it could matter in the future).