0

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.

Dipesh Gandhi
  • 765
  • 1
  • 13
  • 31

2 Answers2

1

cat src/js/*.js | uglifyjs -m -c -o lib/js/min.js

elclanrs
  • 92,861
  • 21
  • 134
  • 171
  • 1
    You can install [git](http://git-scm.com/) and use the mysys bash. Doing web dev in Windows without a proper bash is painful. – elclanrs May 09 '13 at 07:24
0

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.

Dipesh Gandhi
  • 765
  • 1
  • 13
  • 31