underscore-template-strict-loader

An Underscore.js template loader for Webpack that works with strict mode. Underscore templates don't work with strict mode by default because they use the with(data)
function to give you access to your data variables. This plugin works by prefixing each variable in your templates with data.whatever
so {{ name }}
becomes {{ data.name }}
.
Installation
Once you have the Underscore package installed, you can run:
npm install underscore-template-strict-loader
License
underscore-template-strict-loader is MIT licenced.
Usage
module.exports = {
module: {
test: /\.jst/,
loader: 'underscore-template-strict-loader',
query: {
templateSettings: {
evaluate: /\{\[([\s\S]+?)\]\}/,
escape: /\{\{([\s\S]+?)\}\}/,
interpolate: /\{\!([\s\S]+?)\!\}/
},
dataObjName: 'templateData',
globals: ['$', 'jQuery'],
addFilenameComment: true
}
}
};
Other
This is being used in Beta at SpyFu