Real parser and compressor
Terser understands strings, templates, regular expressions, classes, modules and modern syntax. It is substantially safer than removing whitespace and comments with regular expressions.
Parse, compress and mangle JavaScript safely with Terser, configurable compatibility targets, production cleanup and source-map support.
Your minified JavaScript will appear here.
Terser understands strings, templates, regular expressions, classes, modules and modern syntax. It is substantially safer than removing whitespace and comments with regular expressions.
A source map connects minified output to original source locations for debugging. Deploy the map only according to your security and observability policy.
Minification can expose assumptions about globals, function names, evaluation order or side effects. Run your application tests against the generated artifact.
Compression rewrites expressions while mangling shortens local names. Start with conservative settings, enable module and top-level optimization only when the input’s execution model is known, and keep license comments required by your dependencies.
Well-written code normally remains equivalent, but unsafe assumptions, reliance on function or class names, dynamic evaluation, side-effectful console arguments and incorrect module settings can cause differences. Always test.
No. Terser’s output target controls which transformations and syntax forms it may emit; it is not a full transpiler or polyfill system. Use Babel, SWC or your build tool when older browsers must run modern source.
Only intentionally. Removing a call also removes evaluation of its arguments, which can change behavior if those expressions have side effects. Prefer a logging abstraction or build-time policy.
They can reveal original source structure and content. Public maps improve browser debugging but may expose implementation details. Decide deliberately how maps are stored and served.