About     Blog     Github

Uglifying a file

When you want to uglify a single file instead of going through the rails assets precompilation process, you can use the below command

Uglifier.compile(input_file_path)

If you want to spit out the uglified file into an output file, use the below

File.write output_file_name, Uglifier.compile(File.read(input_file_path))