[英]grunt-injector - how to use Grunt's 'dynamically built files objects.'?
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
},
]
但是这种格式在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的特定“动态构建文件对象”与之配合使用的任何建议?
如果有人遇到此问题,我想您不能使用像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'
}
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.