Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uglify directory

Rather than adding code and files to the uglify script individually, is there any way to tell uglify to grab an entire dir, and output into 1 script.js file?

like image 890
Mark Avatar asked Mar 17 '11 23:03

Mark


People also ask

What is Uglify in JavaScript?

Uglify JS is a JavaScript library for minifying JavaScript files. To 'uglify' a JavaScript file is to minify it using Uglify. Uglification improves performance while reducing readability. Encryption: This is the process of translating data, called plain data, into encoded data.

What is Uglify code?

Uglifying is transforming the code into an "unreadable" form by changing variable names, function names, etc, to hide the original content. Once it is used there's no way to reverse it back. Some libraries like UglifyJS does minification when used, by removing unnecessary parts.

How do you minify all JavaScript files?

To minify JavaScript, try UglifyJS. The Closure Compiler is also very effective. You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.


1 Answers

You can use uglifyjs-folder module for that. It also supports processing them individually (no merging together).

https://github.com/ionutvmi/uglifyjs-folder
https://www.npmjs.com/package/uglifyjs-folder

like image 80
icl7126 Avatar answered Sep 28 '22 04:09

icl7126