Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ba2bc6a885 | ||
|
9c8bb20f58 | ||
|
1e0d055cca |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules
|
6
index.js
6
index.js
@ -1,7 +1,11 @@
|
||||
var loaderUtils = require('loader-utils');
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = function (source) {
|
||||
this.cacheable && this.cacheable();
|
||||
var template = _.template(source, null, this.options.tplSettings);
|
||||
|
||||
var options = loaderUtils.getOptions(this) || {};
|
||||
var template = _.template(source, null, options.tplSettings);
|
||||
|
||||
return 'var _ = require(\'underscore\');\nmodule.exports = ' + template;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tpl-loader",
|
||||
"version": "0.2.2",
|
||||
"version": "1.0.0",
|
||||
"description": "Underscore Templates loader for webpack",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@ -28,5 +28,8 @@
|
||||
"bump:major": "npm version major",
|
||||
"bump:minor": "npm version minor",
|
||||
"postversion": "git push origin master --follow-tags"
|
||||
},
|
||||
"dependencies": {
|
||||
"loader-utils": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user