I use the following gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
uglify: {
files: {
cwd: 'public/js',
src: ['**/*.js', '!*.min.js'],
dest: 'public/js/build/',
expand: true,
flatten: true,
ext: '.js'
}
},
watch: {
js: { files: 'public/js/*.js', tasks: [ 'uglify' ] },
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', [ 'uglify' ]);
};
I want to minimize all files in the public/js folder. When I run the script, all jquery.js and jquery.plugin.js files are combined into one minimized jquery.js output file. Is there some setting to prevent this?
Ah, just figured it out.
Add
as an option to uglify.