【发布时间】:2016-09-29 10:44:18
【问题描述】:
我正在使用这个 gulp 插件来使用 nunjucks 来简化 HTML 管理。
https://github.com/carlosl/gulp-nunjucks-render
gulp.task('default', function () {
return gulp.src('src/templates/*.html')
.pipe(nunjucksRender({
path: ['src/templates/'] // String or Array
}))
.pipe(gulp.dest('dist'));
});
我想将我的模板和特定页面的部分保留在不同文件夹中的页面目录下,因此我尝试将路径保留为
path: ['src/templates/', 'src/common-partials/', 'src/pages/**/**/includes/']
但它不起作用。
Template render error: (unknown path)
Error: template not found: component1.nunjucks
我的设置
【问题讨论】:
标签: node.js gulp template-engine nunjucks