This is the structure that I have:
I ended up using gruntjs and a series of grunt tasks to do the job:
The jade file, would be some thing like this:
html head title= "Example Page" include css/css1.css include css/css2.css include js/main.js include js/module1.js body | <img src="data:image/png;base64, include img1.b64 | "/> | <img src="data:image/png;base64, include img2.b64 | "/> canvas#myCanvas
I also used uglify and other excellent predefined tasks to optimize the code.