{"id":25463,"library":"esbuild-webpack-plugin","title":"esbuild-webpack-plugin","description":"A webpack plugin that uses esbuild as a JavaScript minifier. Version 1.1.0 requires webpack 4+ and ships TypeScript type definitions. It provides a faster alternative to TerserPlugin by leveraging esbuild's built-in minification, which can significantly reduce build times especially for large projects. The plugin supports custom esbuild options such as target and minify settings. No other minifier plugin is needed; it replaces TerserPlugin in the webpack minimizer configuration. Development appears active but no recent commits (last commit in 2020).","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: plugin interfaces with webpack's optimization stage","package":"webpack","optional":false},{"reason":"core minification engine (not a direct dependency but must be installed)","package":"esbuild","optional":true}],"imports":[{"note":"Default export is the plugin class. In CommonJS, require().default is needed because of ESM interop.","wrong":"const ESBuildPlugin = require('esbuild-webpack-plugin').default","symbol":"ESBuildPlugin","correct":"import ESBuildPlugin from 'esbuild-webpack-plugin'"},{"note":"Direct require gives an object with default property. Wrong: using esbuild-webpack-plugin as constructor without .default will throw TypeError.","wrong":"const ESBuildPlugin = require('esbuild-webpack-plugin')","symbol":"ESBuildPlugin","correct":"const { default: ESBuildPlugin } = require('esbuild-webpack-plugin')"},{"note":"CommonJS pattern. Works with webpack config files using module.exports.","wrong":"","symbol":"ESBuildPlugin","correct":"const ESBuildPlugin = require('esbuild-webpack-plugin').default"}],"quickstart":{"code":"// webpack.config.js\nconst ESBuildPlugin = require('esbuild-webpack-plugin').default;\n\nmodule.exports = {\n  optimization: {\n    minimizer: [\n      new ESBuildPlugin(),\n    ],\n  },\n};","lang":"javascript","description":"Replaces TerserPlugin with esbuild for minification in webpack 4+."},"warnings":[{"fix":"Use an alternative like esbuild-loader or upgrade to a webpack 5 compatible plugin.","message":"Plugin requires webpack 4+. Does not work with webpack 5.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use require('esbuild-webpack-plugin').default or switch to ES import syntax.","message":"CommonJS require does not return the constructor directly; must use .default","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using esbuild-loader for active maintenance.","message":"Package has not been updated since 2020. May not work with newer esbuild versions.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use require('esbuild-webpack-plugin').default or import syntax.","cause":"CommonJS require returns an object with default property, not the class directly.","error":"TypeError: ESBuildPlugin is not a constructor"},{"fix":"Ensure you instantiate the plugin: new ESBuildPlugin(). Not a reference to the class.","cause":"Minimizer expects a plugin instance, but ESBuildPlugin is used incorrectly.","error":"Error: webpack.optimize.minimizer[0] is not a plugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}