I use this trick to solve the problem:
var ejs = require('ejs');
ejs.open = '{{';
ejs.close = '}}';
app.register('.html', ejs);
app.set('views', __dirname + '/views');
app.set('view engine', 'html');
This changes <%%> to {{}} and allows me to use <%%> for templates that are used by JS. This works for me as I don't have classic style templates (<%%>).
If you have many of these, you might want to do the same trick, but for underscore.js templates.
kravc source
share