Terser Plugin
Terser minifies and optimizes JavaScript for ES6+. Successor to UglifyJS.
Usage Examples
- "minify app.js for production"
- "compress with source map generation"
- "mangle variable names for size reduction"
- "remove console.log statements from build"
Installation
npm install -g terser
Key Features
- ES6+ syntax support
- Variable name mangling
- Dead code elimination
- Tree shaking
- Expression optimization
- Source map generation
- Comments preservation or removal
- Configurable compression level