2014-07-15 49 views
1

步兵的动态生成的文件中的对象是结构:grunt-injector - 如何使用Grunt的'动态构建文件对象'?

files: [ 
     { 
      expand: true,  // Enable dynamic expansion. 
      cwd: 'lib/',  // Src matches are relative to this path. 
      src: ['**/*.js'], // Actual pattern(s) to match. 
      dest: 'build/', // Destination path prefix. 
      ext: '.min.js', // Dest filepaths will have this extension. 
      extDot: 'first' // Extensions in filenames begin after the first dot 
     }, 
] 

但是这种格式不咕噜,喷油器工作:

injector: { 
    options: { 
    destFile : 'app/static/index.html', 
    ignorePath: 'app/' 
    }, 
    local_dependencies: { 
    files: [ 
      expand: true, 
      cwd: 'app/static/css/', 
      src: ['*.css'], 
      dest: '/static/css', 
      ext: '.css' 
      ] 
    } 
}, 

如何,我可以用任何建议咕噜的特定的“动态生成文件对象“?

回答

2

如果有人有这个问题,我猜你不能使用像local_dependencies这样的子类别。

此为我工作:

injector: { 
     options: { 
     destFile : 'app/static/index.html', 
     ignorePath: 'app/' 
     }, 
      files: { 
       expand: true, 
       cwd: 'app/static/css/', 
       src: ['*.css'], 
       dest: 'app/static/css', 
       ext: '.css' 
       } 
    },