I want to use this grunt uglify setup shown in the accepted answer here: How to minify multiple Javascript files in a folder with UglifyJS?
However I only want to run it on files that are unminified, can uglify check this or not?
If not, any way of making it do this? Either by checking the size of the file/number of lines or maybe just checking if the file name ends in '.min.js'
When you set the src
for the uglify task to
src: ['js/*.js', '!js/*.min.js'],
All the .min.js
files are not processed by uglify.
See also: http://gruntjs.com/configuring-tasks#globbing-patterns
You need to follow these build steps:
src: ['js/*.js', '!js/*.min.js']
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.