我想将 mustache 与 node 一起使用,但由于某些原因,partials 不起作用:我已经创建了 2 个文件,app.js
并且test.mustache
,它们都在同一个目录中。使用package.json
文件和 npm 我已经为这个项目安装了最新版本的 mustache。文件如下所示:
应用程序.js:
var mus = require('mustache');
console.log(mus.render('test.mustache: {{>test}}'));
test.mustache:
This is a test
如果我运行,node app.js
我希望得到以下输出:test.mustache: This is a test
,但我只是得到:test.mustache:
。
其他 mustache 标签确实按预期工作,甚至 mustache 的 vows 测试也不会报告任何错误。
我应该怎么做才能让它正常工作?