EN
JavaScript - compress js files with terser (supports ES6+)
5
points
In this short article, we would like to show how to use terser
to compile js files to minified versions (*.min.js
).
Quick solution (run following command):
cat input.js | npx terser --compress --mangle > output.min.js
Terser advantages:
- has support for ES6+,
- effective compression.
Installation
We can install terser
globally using:
npm install -g terser