spatools/grunt-html-build

Multiple sources fail to build

mlamer opened this issue · 1 comments

Great grunt-html-build builds perfect for a single "src:", but if you use an array of sources it overwrites the "/index.html" with "/aboutus/index.html" while building.

  htmlbuild: {
      dist: {
        //src: '<%= config.dist %>/index.html',
        src: ['<%= config.dist %>/index.html', '<%= config.dist %>/aboutus/index.html'],
        dest: '<%= config.dist %>',
        options: {
          beautify: true,
          prefix: '//some-cdn',
          relative: true,
          sections: {
            nav: {
              home: '<%= config.app %>/templates/nav-home.html',
              aboutus: '<%= config.app %>/templates/nav-aboutus.html'
            }
          }
        }
      }
    }

Hi,

Sorry for my delayed answer.
Indeed, by default, grunt-html-build is only using the filename as destination path.

But you can use alternate files config to match your needs :

htmlbuild: {
    files: [{
        expand: true,
        cwd: "<%= config.dist %>",
        src: ["index.html", "aboutus/index.html"],
        dest: "<%= config.dist %>"
    }],
    options: {
        //...
    }
}

Thanks.