bsr*_*bsr 14 javascript gruntjs
为grunt复制任务指定单个文件副本的格式是什么
copy:{
dist:{
files:[
{
expand:true,
cwd:'<%= yeoman.app %>',
dest:'<%= yeoman.dist %>/scripts/jq.min.js',
src: ['components/jq/dist/jq.min.js']
}
]
Run Code Online (Sandbox Code Playgroud)
如果我的 yeoman.app目录是A和yeoman.dist是B,这将文件复制到
/b/scripts/jq.min.js/components/jq/dist/jq.min.js
Run Code Online (Sandbox Code Playgroud)
我想要的是复制它 /b/scripts/jq.min.js
我怎样才能做到这一点.
编辑:我看到一个实现支持的问题. https://github.com/gruntjs/grunt-contrib-copy/issues/3
Bri*_*wis 27
这有用吗?
copy: {
dev: {
files: [{
cwd: '<%= yeoman.app %>/components/jq/dist/',
src: 'jq.min.js',
dest: '<%= yeoman.dist %>/scripts/',
expand: true
}]
}
}
Run Code Online (Sandbox Code Playgroud)
小智 5
使用展平将多个源文件位置复制到单个目标文件夹。
copy: {
dev: {
files: [{
cwd: '<%= yeoman.app %>',
src: ['/components/jq/dist/jq.min.js','/components/jq/dist/jq2.min.js', '/components/bs/dist/bs.js'],
dest: '<%= yeoman.dist %>/scripts/',
expand: true,
flatten: true
}]
}
}Run Code Online (Sandbox Code Playgroud)