Copy: {
//This is one of the target dests in the task
: {
expand:true,
cwd: ' <%=config.app%>/newfolder ',
SRC: [' **/{a*,b*}.html '],
dest: ' <%=config.dist%>/newfolder ',
ext: ". shtml",
Extdot: "A",
flatten:true,//get rid of the middle fooled, the following rename can be found again
rename:function (dest, fileName) {return
dest + "/" +filename;< c12/>}}}
Wildcard support: Supported by the Nodejs built-in Node-glob library, which can be used in the various file configurations described above
1, * match any character, in addition to/
2. Match a single character, except/
3, * * matches any character, including/, so used in the directory path
4, {} comma-separated "or" action (no spaces after commas)
5,! Exclude a match
Dynamically generate file name:
Expand set to True open the following options, if set to true, to indicate that the following file name placeholder (that is, *) is extended to a specific file name.
CWD the directory where all SRC-specified files are specified relative to this property, and the files (input) that need to be processed
SRC to match the path, relative to the CWD, represents the file that needs to be processed. If you take an array, each item in the array is a filename, and you can use the wildcard character
Dest the generated target path prefix that represents the processed file name or destination
Ext represents the file suffix name after processing. Replace all generated target file suffixes with this property
Extdot:first: Indicates that the suffix name begins after the first point after the filename; Last: Indicates that the suffix name starts after the final point after the filename
Flatten: Deletes the path portion of all generated dest, the value is Boolean (True, false) to specify whether to keep the file directory structure, true is to keep the file directory
Rename a function that accepts a matching file name and matches the target location, returning a new target path
The above is the introduction of this article in the configuration of the task of grunt wildcard support and dynamic generation of file names, I hope to help.