简体   繁体   English

组装中有多个输出扩展

[英]Multiple output extensions in assemble

I have a grunt file like this (part of the assemble config): 我有一个像这样的咕unt声文件(汇编配置的一部分):

pages: {
    files: [{expand: true,
      cwd: 'src/pages/',
      src: '**/*.hbs',
      dest: 'dist/',
      ext: '.html'
    }]
  }

This way it takes every hbs file and renderes them with html extension. 这样,它将获取每个hbs文件,并使用html扩展名呈现它们。 Is it possible to have a css file in the same folder as the .hbs file, and that assemble moves it to the same folder as the compiled html file. 是否有一个css文件与.hbs文件位于同一文件夹中,并且该汇编将其移动到与已编译的html文件相同的文件夹中。

To explain some more, i want every file other than .hbs files to just be moved to the same location as the compiled hbs file. 为了进一步说明,我希望将除.hbs文件之外的每个文件都移到与已编译的hbs文件相同的位置。 Is this possible with Assemble? 组装可能吗?

I solved it with another Grunt plugin, the grunt-contrib-copy and this task: 我用另一个Grunt插件grunt-contrib-copy和以下任务解决了这个问题:

copy: {
  main: {
    files: [ 
      {expand: true, cwd: 'src/pages/', src: ['**', '!**/*.hbs'], dest: 'dist/', filter: 'isFile'}
    ]
  }
},

This way it copies every file other than hbs files to the same folders as assemble generates the html-files. 这样,它将除hbs文件以外的每个文件复制到汇编生成html文件的相同文件夹中。

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

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