I am new to uglify-js
. I want to minify all javascript files from src/js/
directory to lib/js/
. Is there any command to minify all js files directory?
Thanks in advance.
I am new to uglify-js
. I want to minify all javascript files from src/js/
directory to lib/js/
. Is there any command to minify all js files directory?
Thanks in advance.
cat src/js/*.js | uglifyjs -m -c -o lib/js/min.js
Thanks James,
It’s working using grunt-contrib-uglify
.
Here is the code.
uglify: {
compress: {
files: [{
expand: true,
cwd: 'src/js',
src: ['*.js'],
dest: 'lib/js/',
ext: '.min.js'
}]
}
}
It will minify all js to destination separately. I found from here.