Dynamically generate file names
expand
Set to true
open the following options
cwd
The path specified by all src
specified files relative to this property
src
To match the path, relative to the CWD
dest
The target path prefix of the build
ext
Replace all generated target file suffixes with this property
flatten
Delete all generated dest
paths section
rename
A function that accepts a match to the file name, and matches the target location, returning a new destination path
Grunt.initconfig ({minify: {dynamic_mappings: {//Grunt would search for "**/?". JS "under" lib/"when the" Minify "task runsfiles: [{expand:true,//Enable dynamic expansion.CWD: ' lib/'//SRC matches is relative to this path.SRC: [' **/?. JS '],//Actual pattern (s) to match.Dest: ' build/',//Destination path prefix.Ext: '. Min.js ',//Dest filepaths 'll has this extension. } ] } }});
Original: Http://www.hulufei.com/post/grunt-introduction
"Go" grunt dynamically generated file name