在我的 Gruntfile 中我有
jade: {
html: {
expand: true,
src: ['public/views/**/*.jade'],
dest: '.tmp',
ext: '.html'
}
},
它确实将 .jade 文件编译为 html,但包含 public/目录,从而生成 .tmp/public/views/foo.html,但我想要 .tmp/views/foo.html。
我为 Express 添加了一个额外的静态路径,它允许返回 public/*/.html,但最好保持干净。
有什么想法吗?
最佳答案
试试这个:
jade: {
html: {
files: [{
expand: true,
cwd: 'public/',
src: ['views/**/*.jade'],
dest: '.tmp',
ext: '.html'
}]
}
}
关于pug - 编译的 .jade 文件的 Gruntfile 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17332550/