Babel plugin that integrates UglifyJS minification directly into the Babel pipeline without needing to generate and re-parse code. v1.0.2 is the latest stable release. This plugin works on the Mozilla AST (SpiderMonkey format) used internally by Babel, avoiding repeated code generation and parsing. It is intended for Babel 5.x only, as Babel 6+ uses different AST formats. No longer actively maintained; alternatives include babel-minify (babili) or terser-based plugins. Key differentiator: direct AST-level minification preserves source maps and avoids overhead of stringifying and re-parsing code.
npm install babel-plugin-uglifyVerified import paths — ran on the pinned version, not inferred.
Shows how to configure babel-plugin-uglify via .babelrc and Node API, including the required ':after' suffix.
Migrate to @babel/plugin-minify (babel-minify) or babel-plugin-terser.
Use Babel 5 or switch to a Babel 6+ compatible minifier.
Add ':after' suffix to plugin name in .babelrc or programmatic options.
Use babel-plugin-terser instead of babel-plugin-uglify.
Install and configure Babel presets (e.g., babel-preset-es2015) in .babelrc or programmatic options.
Ensure plugin is specified with ':after' suffix (e.g., 'uglify:after') so it runs after ES6 transforms.
Use Babel 5 API (require('babel')) or switch to a Babel 6+ compatible minifier plugin.