NodeJS: Minimize all the JS files in a directory using Uglify-js

/ Published in: JavaScript
Save to your folder(s)

If you happen to have 5 or 6 javascript files that you'd like to compress into 1, then try uglify within terminal.

Copy this code and paste it in your HTML
  1. //First download uglify-js. The -g params allows you to make command-line tools
  2. //sudo npm install -g uglify-js
  3. cat * | uglifyjs -o script.js

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.