Add default value to options
This commit is contained in:
parent
9c8bb20f58
commit
ba2bc6a885
2
index.js
2
index.js
@ -4,7 +4,7 @@ var _ = require('lodash');
|
|||||||
module.exports = function (source) {
|
module.exports = function (source) {
|
||||||
this.cacheable && this.cacheable();
|
this.cacheable && this.cacheable();
|
||||||
|
|
||||||
var options = loaderUtils.getOptions(this);
|
var options = loaderUtils.getOptions(this) || {};
|
||||||
var template = _.template(source, null, options.tplSettings);
|
var template = _.template(source, null, options.tplSettings);
|
||||||
|
|
||||||
return 'var _ = require(\'underscore\');\nmodule.exports = ' + template;
|
return 'var _ = require(\'underscore\');\nmodule.exports = ' + template;
|
||||||
|
Loading…
Reference in New Issue
Block a user