grunt-injector – 如何使用Grunt的“dynamic构build文件对象”?

Grunt的dynamic构build的文件对象的结构如下:

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 }, ] 

但是这种格式在grunt-injector中不起作用:

 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' ] } }, 

任何关于如何使用Grunt特定的“dynamic构build的文件对象”的build议?

如果有人有这个问题,我猜你不能使用像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' } },