我只是扩展了文件系统加载器,例如:
var nunjucks = require('nunjucks');
MyLoader = nunjucks.FileSystemLoader.extend({
getSource: function(name) {
return this.parent().getSource(name);
}
});
我怎么总是得到:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.resolve (path.js:426:5)
at Loader.extend.getSource (/home/myname/myapp/node_modules/nunjucks/src/node-loaders.js:60:26
如何getSource
正确调用父方法?
请帮忙。谢谢