Middleware precompiles templates on-the-fly for execution in the browser