简体   繁体   English

运行Grunt Build无法编译Jade文件

[英]Running Grunt Build does not compile jade files

I implemented Jade template engine, Yeoman-AngularJS app, it is working fine on my local. 我实现了Jade模板引擎Yeoman-AngularJS应用,在我的本地设备上运行良好。

But when deploying it, running Grunt Build does not compile .jade files. 但是在部署它时,运行Grunt Build不会编译.jade文件。 That's why I am getting an error Cannot GET / on production. 这就是为什么我在生产时遇到错误Cannot GET / ”的原因。

You can see in the output folder if the html files are being correctly generated. 您可以在输出文件夹中查看是否正确生成了html文件。 You can see in the grunt file the destination folder (in my case .tmp) and the specific options. 您可以在grunt文件中看到目标文件夹(在我的情况下是.tmp)和特定的选项。 Perhaps the src rule is not matching your source file. 也许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'
    }]
  }
},

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM