{"id":20846,"library":"webpack-uglify-js-plugin","title":"webpack-uglify-js-plugin","description":"An incremental UglifyJS plugin for webpack, version 1.1.9. Designed to cache minification results to speed up builds, it applies UglifyJS only to changed modules. Provides options for caching, source maps, compressor settings, and output configuration. No active releases since 2016; consider using webpack's built-in terser-webpack-plugin instead, which is actively maintained and supports modern JavaScript.","status":"deprecated","version":"1.1.9","language":"javascript","source_language":"en","source_url":"https://github.com/pingyuanChen/webpack-uglify-js-plugin","tags":["javascript","webpack","plugin","uglifyjs"],"install":[{"cmd":"npm install webpack-uglify-js-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-uglify-js-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-uglify-js-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for minification","package":"uglify-js","optional":false}],"imports":[{"note":"Package uses CommonJS; no default export for ES6 imports.","wrong":"import webpackUglifyJsPlugin from 'webpack-uglify-js-plugin';","symbol":"default","correct":"var webpackUglifyJsPlugin = require('webpack-uglify-js-plugin');"},{"note":"TypeScript with esModuleInterop: import * as webpackUglifyJsPlugin from 'webpack-uglify-js-plugin';","wrong":"","symbol":"default","correct":"import webpackUglifyJsPlugin = require('webpack-uglify-js-plugin');"},{"note":"Export is a single function, not an object.","wrong":"const { webpackUglifyJsPlugin } = require('webpack-uglify-js-plugin');","symbol":"default","correct":"const webpackUglifyJsPlugin = require('webpack-uglify-js-plugin');"}],"quickstart":{"code":"var path = require('path');\nvar webpackUglifyJsPlugin = require('webpack-uglify-js-plugin');\n\nmodule.exports = {\n  plugins: [\n    new webpackUglifyJsPlugin({\n      cacheFolder: path.resolve(__dirname, 'cached_uglify/'),\n      debug: false,\n      minimize: true,\n      sourceMap: false,\n      output: {\n        comments: false\n      },\n      compressor: {\n        warnings: false\n      }\n    })\n  ]\n};","lang":"javascript","description":"Configures webpack to use UglifyJS plugin with caching enabled, source maps off, and comments removed."},"warnings":[{"fix":"Replace with terser-webpack-plugin: npm install terser-webpack-plugin --save-dev","message":"Package is unmaintained since 2016; use terser-webpack-plugin instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Run: npm install uglify-js --save-dev","message":"Requires uglify-js as a peer dependency; not automatically installed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove any webpack.optimize.UglifyJsPlugin configuration.","message":"Options structure may conflict with webpack's built-in UglifyJsPlugin; use only this plugin's options.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install uglify-js --save-dev","cause":"Missing peer dependency uglify-js","error":"Error: Cannot find module 'uglify-js'"},{"fix":"Use require('webpack-uglify-js-plugin') directly.","cause":"Incorrect import, e.g., using ES6 default import without proper interop","error":"TypeError: webpackUglifyJsPlugin is not a constructor"},{"fix":"Refer to the plugin's documentation for allowed options.","cause":"Mixing options from terser-webpack-plugin or webpack's built-in plugin","error":"Invalid options object. UglifyJs Plugin has been initialized using an options object that does not match the API schema."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}