【问题标题】:Grunt jade compiles and merges multiple jade files into single htmlGrunt Jade编译合并多个jade文件为单个html
【发布时间】:2013-05-05 00:52:32
【问题描述】:

约曼/咕噜/玉

我的文件夹结构如下:

App/
App/jade/user.jade
        /user.edit.jade
        /user.details.jade

当翡翠编译文件时,它会为所有三个单独的文件创建单个 html 文件作为 (App/user.html)。

我需要它作为所有三个单独的文件:

App/user.html
   /user.edit.html
   /user.details.html

我的 grunt 配置如下:

    jade: {
        dist: {
            options: {
                pretty: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/jade',
                    src: '{,*/}*.jade',
                    dest: '<%= yeoman.app %>/',
                    ext: '.html'             
                  }]                
              }
    },

我错过了什么吗?请提出建议。

【问题讨论】:

    标签: pug gruntjs


    【解决方案1】:

    此配置对我有用:

    jade: {
      dist: {
        options: { pretty: true }
        files: [
          expand: true,
          cwd: 'jade',
          src: [ '**/*.jade' ],
          dest: 'app',
          ext: '.html'
        ]
      }
    }
    

    【讨论】:

      【解决方案2】:

      我看不出它是如何编译user.html 的,因为files 数组不应该在options 中。 files 数组看起来是正确的。

      【讨论】:

        猜你喜欢
        • 2013-07-21
        • 2016-09-04
        • 1970-01-01
        • 2014-08-24
        • 2014-11-02
        • 2015-09-30
        • 2015-08-21
        • 2016-03-13
        • 2013-10-29
        相关资源
        最近更新 更多