tpl-loader/index.js
2018-06-15 15:12:43 +02:00

12 lines
342 B
JavaScript

var loaderUtils = require('loader-utils');
var _ = require('lodash');
module.exports = function (source) {
this.cacheable && this.cacheable();
var options = loaderUtils.getOptions(this) || {};
var template = _.template(source, null, options.tplSettings);
return 'var _ = require(\'underscore\');\nmodule.exports = ' + template;
};