middleware for on-demand javascript bundling