mishoo/UglifyJS ? reverse-engineered prompt

Reverse engineered prompt

Build me a command-line tool in JavaScript that helps me manage my JS code for web projects. The main thing I need is a way to minify my code for production. It should take one or more JavaScript files, parse them, and then compress them into a much smaller file. This should include removing whitespace and comments, and also "mangling" the code by shortening variable and function names to save space, which will help my site load faster.

I also want it to be able to do the opposite: a "beautifier" feature that can take messy or minified code and reformat it with proper indentation and spacing to make it readable again.

It should be a CLI app that I can install with npm. I'll need to pass it input files and set an output file, and it should support lots of options for controlling the compression, mangling, and beautifying process, like generating source maps for debugging.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab