This is used to generate a templates.js
file where the keys are template identifiers and the values are the raw, escaped EJS templates.
Templates are semi-compiled server side. Results of compilation are memoized on the client side using Underscore.
This is useful for maintaining multiple template files server-side and compiling them into a client-side script.
This requires the use of the ejs
client side library. Requires ejs
to be available on window
. See: https://github.com/visionmedia/ejs#client-side-support
@sylvinus actually using it on the client side. at the time I wrote this, i was not able to get ejs.compile() working on the server side. the compiled templates were generated but not executable in the browser.