Add default value to options

This commit is contained in:
rubenmoya 2018-06-15 15:12:43 +02:00
parent 9c8bb20f58
commit ba2bc6a885

View File

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