UglifyJS is a popular tool for minifying your source code for production. It can dramatically reduce the size of your files by eliminating whitespace, rewriting variable names, removing dead code branches, and more.
We strongly encourage you to use a higher level bundler (or transpiler) as UglifyJS configuration can get quite complicated to achieve the desired results.
If you are using UglifyJS to minify your source code, the following command will additionally generate a source map that maps the minified code back to the original source:
uglifyjs app.js \ -o app.min.js.map \ --source-map url=app.min.js.map,includeSources