yeoman/grunt-usemin — pull request #162 by trask (2013-08-15 09:08:37+00:00)
Title: Support multiple targets in useminPrepare

It would be useful to be able to have multiple targets for the useminPrepare task. It looks like multiple targets are supported for the usemin task via #58, but not for useminPrepare yet. This PR adds multiple targets for the useminPrepare task.

For more info, the useminPrepare configuration I would like to use is something like this:

useminPrepare: {
dist: {
files: {'<%= yeoman.dist %>/index.html': '<%= yeoman.app %>/index.html'},
options: {
dest: '<%= yeoman.dist %>'
}
},
dist2: {
files: {'<%= yeoman.dist2 %>/something.html': '<%= yeoman.app %>/something.html'},
options: {
dest: '<%= yeoman.dist2 %>'
}
}
}

So, actually, I wouldn't mind having a single target and doing this:

useminPrepare: {
dist: {
files: {
'<%= yeoman.dist %>/index.html': '<%= yeoman.app %>/index.html',
'<%= yeoman.dist2 %>/something.html': '<%= yeoman.app %>/something.html'
}
}
}

But this would require `dest` to default to the destination file's directory, which would be a change from current behavior, whereas adding support for multiple targets doesn't change any existing usage.