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))
Like what you read? Give Gautam Chandra N a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.