Update for webpack 4

This commit is contained in:
rubenmoya 2018-06-15 09:20:04 +02:00
parent 46e19768e3
commit 1e0d055cca
3 changed files with 9 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -1,7 +1,11 @@
var loaderUtils = require('loader-utils');
var _ = require('lodash'); var _ = require('lodash');
module.exports = function (source) { module.exports = function (source) {
this.cacheable && this.cacheable(); 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; return 'var _ = require(\'underscore\');\nmodule.exports = ' + template;
}; };

View File

@ -28,5 +28,8 @@
"bump:major": "npm version major", "bump:major": "npm version major",
"bump:minor": "npm version minor", "bump:minor": "npm version minor",
"postversion": "git push origin master --follow-tags" "postversion": "git push origin master --follow-tags"
},
"dependencies": {
"loader-utils": "^1.1.0"
} }
} }