Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GruntJS处理多个目录_Gruntjs - Fatal编程技术网

GruntJS处理多个目录

GruntJS处理多个目录,gruntjs,Gruntjs,我已经通过yeoman安装了bootstrap 3环境。它附带一个预定义的gruntfile。现在我对Grunt完全是新手,虽然大部分都是开箱即用的,但我需要对配置进行一个简单的更改。我有两个语言目录/en/和/de/以及html文件。当前GrunFile设置为仅处理根目录中的index.html 查看构建任务及其作业,我发现我必须编辑“useminprepare”、“usemin”和“htmlmin”的配置。我不明白的是包含2个附加目录的语法 useminPrepare: { html:

我已经通过yeoman安装了bootstrap 3环境。它附带一个预定义的gruntfile。现在我对Grunt完全是新手,虽然大部分都是开箱即用的,但我需要对配置进行一个简单的更改。我有两个语言目录/en/和/de/以及html文件。当前GrunFile设置为仅处理根目录中的index.html

查看构建任务及其作业,我发现我必须编辑“useminprepare”、“usemin”和“htmlmin”的配置。我不明白的是包含2个附加目录的语法

useminPrepare: {
  html: '<%= yeoman.app %>/**/*.html',
  options: {
    dest: '<%= yeoman.dist %>'
  }
},
usemin: {
  html: ['<%= yeoman.dist %>/**/*.html'],
  css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
  options: {
    dirs: ['<%= yeoman.dist %>/**/']
  }
},

[...]

htmlmin: {
  dist: {
    options: {
    },
    files: [{
      expand: true,
      cwd: '<%= yeoman.app %>',
      src: '{,*/}*.html',
      dest: '<%= yeoman.dist %>'
    }]
  }
},
你可以读到这篇文章,它对我非常有用,如果你仍然不明白,等我回家后我会详细解释答案

  grunt.registerTask('build', [
    'clean:dist',
    'copy:server',
    'useminPrepare',
    'concurrent',
    'cssmin',
    'concat',
    'uglify',
    'copy',
    'rev',
    'usemin'
  ]);