【发布时间】:2015-05-29 09:34:36
【问题描述】:
我实现了 Jade 模板引擎 Yeoman-AngularJS 应用程序,它在我的本地运行良好。
但在部署时,运行Grunt Build 不会编译 .jade 文件。
这就是为什么我在生产中收到错误Cannot GET /。
【问题讨论】:
我实现了 Jade 模板引擎 Yeoman-AngularJS 应用程序,它在我的本地运行良好。
但在部署时,运行Grunt Build 不会编译 .jade 文件。
这就是为什么我在生产中收到错误Cannot GET /。
【问题讨论】:
您可以在输出文件夹中查看是否正确生成了 html 文件。 您可以在 grunt 文件中看到目标文件夹(在我的情况下为 .tmp)和特定选项。可能 src 规则与您的源文件不匹配。
// Compiles Jade to html
jade: {
compile: {
options: {
data: {
debug: false
}
},
files: [{
expand: true,
cwd: '<%= yeoman.client %>',
src: [
'{app,components}/**/*.jade'
],
dest: '.tmp',
ext: '.html'
}]
}
},
【讨论】: