there are some js files in static/js/
1. a.js
2. b.js
3. c.js
how to config grunt.js to get below files:
1. a.min.js
2. b.min.js
3. c.min.js
as far, I have to type specific file name:
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}
In grunt 0.4 you can specify multiple dest/src pairs like this:
From the grunt docs for min:
So you can do this:
There's nothing special about the name 'dist' for these tasks.
You also can use copy and grunt-mindirect.
This should work.
I guess it only matters for watch tasks.
In grunt 0.4 you can do this
After that just start
grunt watch
and all will be fine automagically.Or you can use expandMapping, like this:
And the output:
path/test.js => destination/path/test.min.js
path2/foo.js => destination/path2/foo.min.js
Use the
ext
option to name the files.min.js
instead of.js