{"id":19011,"library":"babel-minify-webpack-plugin","title":"Babel Minify Webpack Plugin","description":"A webpack plugin that uses babel-minify (formerly babili) to minify JavaScript bundles. Current stable version is 0.3.1, released March 2018. Last release was a bugfix for webpack 4 tapable deprecation warnings. The plugin operates on entire chunks rather than individual files, enabling optimizations not possible with loader-based minification. However, it is slower than using babel-loader with the minify preset. The package has narrow engine requirements (Node 4.3–5.0 or >=5.10) and is essentially in maintenance mode, with no releases since 2018 and webpack 5 not officially supported. Alternatives include terser-webpack-plugin and babel-loader with preset-minify.","status":"maintenance","version":"0.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/webpack-contrib/babel-minify-webpack-plugin","tags":["javascript","babel","babel-minify","minify","webpack","webpack-plugin"],"install":[{"cmd":"npm install babel-minify-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add babel-minify-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-minify-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to function as a webpack plugin","package":"webpack","optional":false}],"imports":[{"note":"This package does not ship a default ESM export; use CommonJS require.","wrong":"import MinifyPlugin from 'babel-minify-webpack-plugin';","symbol":"MinifyPlugin","correct":"const MinifyPlugin = require('babel-minify-webpack-plugin');"},{"note":"Direct require yields the constructor; .default is not defined.","wrong":"const Minify = require('babel-minify-webpack-plugin').default;","symbol":"MinifyPlugin","correct":"// webpack.config.js\nconst MinifyPlugin = require('babel-minify-webpack-plugin');"},{"note":"First argument is minify options (babel-preset-minify), second is plugin options (test, include, exclude, comments, sourceMap, etc.). Confusing the two arguments is common.","wrong":"plugins: [new MinifyPlugin({ comments: false })]","symbol":"MinifyPlugin","correct":"plugins: [new MinifyPlugin({ mangle: { topLevel: true } }, { sourceMap: true })]"}],"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\nconst MinifyPlugin = require('babel-minify-webpack-plugin');\n\nmodule.exports = {\n  mode: 'production',\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new MinifyPlugin(\n      { mangle: { topLevel: true } },\n      { comments: false, sourceMap: false }\n    )\n  ]\n};","lang":"javascript","description":"Webpack 4 configuration with babel-minify-webpack-plugin, including minify and plugin options."},"warnings":[{"fix":"Update constructor to `new BabiliPlugin(babiliOptions, overrides)` or use v0.3.1 (named babel-minify-webpack-plugin) with `new MinifyPlugin(minifyOpts, pluginOpts)`.","message":"API changed from `new BabiliPlugin(options)` to `new BabiliPlugin(babiliOptions, overrides)` in v0.0.9.","severity":"breaking","affected_versions":"<=0.0.8"},{"fix":"Install babel-minify-webpack-plugin instead of babili-webpack-plugin.","message":"Renamed from babili-webpack-plugin to babel-minify-webpack-plugin in v0.2.0. Old package is deprecated.","severity":"deprecated","affected_versions":"<0.2.0"},{"fix":"Use Node >= 4.3 < 5.0 or >= 5.10 (e.g., Node 6+).","message":"Node engine requirement: \">= 4.3 < 5.0.0 || >= 5.10\". Node 5.0.0–5.9.x is not supported.","severity":"gotcha","affected_versions":"all"},{"fix":"Use terser-webpack-plugin for webpack 5, or test with this plugin but expect issues.","message":"Webpack 5 is not officially supported. The last release targets webpack 2, 3, and 4.","severity":"gotcha","affected_versions":"all"},{"fix":"Use babel-loader with `presets: ['minify']` and enable `mangle.topLevel` if needed.","message":"The plugin operates on the entire chunk, which can be slow for large bundles. Consider using babel-loader with preset-minify for faster builds.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install babel-minify-webpack-plugin --save-dev` and use correct import.","cause":"Package not installed or incorrectly named.","error":"Error: Cannot find module 'babel-minify-webpack-plugin'"},{"fix":"Use `const MinifyPlugin = require('babel-minify-webpack-plugin');` instead of `import MinifyPlugin from '...'`.","cause":"Using ES6 import when the package does not have a default ESM export.","error":"TypeError: MinifyPlugin is not a constructor"},{"fix":"Ensure the plugin is instantiated with `new MinifyPlugin(...)` inside the `plugins` array.","cause":"Incorrect usage in webpack configuration (e.g., not instantiating the plugin).","error":"Error: Plugin invalid: A non-default property of a plugin was used"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}