{"id":20642,"library":"unminified-webpack-plugin","title":"unminified-webpack-plugin","description":"A webpack plugin that generates unminified copies of JavaScript bundles alongside their minified versions, eliminating the need for two separate webpack runs. Currently at v3.0.0, it supports webpack 4 and 5 with a peer dependency on webpack ^5.36.2. Unlike alternatives that require running webpack twice or using custom scripts, this plugin integrates directly into the webpack plugin system and automatically detects minified filenames (containing 'min'). It works with both JS and CSS assets, supports BannerPlugin, and offers include/exclude filters and a configurable postfix for filenames without 'min'.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/leftstick/unminified-webpack-plugin","tags":["javascript","unminified","webpack"],"install":[{"cmd":"npm install unminified-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add unminified-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add unminified-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency – plugin requires webpack 5.x to function","package":"webpack","optional":false}],"imports":[{"note":"Package does not ship TypeScript types and uses CommonJS; ESM import may cause issues in Node environments without CJS interop.","wrong":"import UnminifiedWebpackPlugin from 'unminified-webpack-plugin';","symbol":"default (UnminifiedWebpackPlugin)","correct":"const UnminifiedWebpackPlugin = require('unminified-webpack-plugin');"},{"note":"Options are passed as an object to the constructor, not as method calls.","wrong":"new UnminifiedWebpackPlugin.postfix('unmin')","symbol":"UnminifiedWebpackPlugin as class","correct":"new UnminifiedWebpackPlugin({ postfix: 'unmin' })"},{"note":"Do not pass webpack configuration options like mode to the plugin; only plugin-specific options (postfix, include, exclude) are accepted.","wrong":"new UnminifiedWebpackPlugin({ mode: 'production' })","symbol":"UnminifiedWebpackPlugin with webpack 5","correct":"const UnminifiedWebpackPlugin = require('unminified-webpack-plugin');\nnew UnminifiedWebpackPlugin()"}],"quickstart":{"code":"const path = require('path');\nconst webpack = require('webpack');\nconst UnminifiedWebpackPlugin = require('unminified-webpack-plugin');\n\nmodule.exports = {\n    mode: 'production',\n    entry: { index: './src/index.js' },\n    output: {\n        path: path.resolve(__dirname, 'dist'),\n        filename: 'library.min.js'\n    },\n    plugins: [\n        new UnminifiedWebpackPlugin()\n    ]\n};","lang":"javascript","description":"Minimal configuration to produce both minified (library.min.js) and unminified (library.js) bundles in one webpack build."},"warnings":[{"fix":"Ensure your project uses webpack ^4.0.0 or ^5.36.2.","message":"Dropped support for webpack 3 and below. Plugin v3.0.0 only supports webpack 4 and 5.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Set a custom postfix, e.g., { postfix: 'unmin' }.","message":"The 'nomin' postfix default is deprecated in favor of explicit 'postfix' option. Using 'nomin' may produce unexpected filenames when output.filename does not contain 'min'.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure webpack mode is set to 'production' or optimization.minimize is enabled. The plugin relies on the presence of minified output.","message":"Plugin may not work correctly with webpack's default optimization settings that include minimized output.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Update to the latest version (>=1.4.0) which handles 'ext' properly.","message":"Filenames that contain 'min' as part of a word (e.g., 'Admin') are incorrectly treated as minified, leading to missing or malformed unminified copies.","severity":"gotcha","affected_versions":">=1.2.0 <1.4.0"},{"fix":"Upgrade to v1.4.0 or later.","message":"When using BannerPlugin with older versions, banner info is not applied to the unminified output.","severity":"gotcha","affected_versions":"<1.4.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev unminified-webpack-plugin and ensure it is present in node_modules.","cause":"Plugin not installed or missing from package.json devDependencies.","error":"Error: Cannot find module 'unminified-webpack-plugin'"},{"fix":"Use require instead: const UnminifiedWebpackPlugin = require('unminified-webpack-plugin');","cause":"Trying to use ESM import pattern without default export interop.","error":"TypeError: UnminifiedWebpackPlugin is not a constructor"},{"fix":"Update to version 3.0.0 or later: npm install unminified-webpack-plugin@latest.","cause":"Plugin version <3.0.0 does not support webpack 5.","error":"Error: webpack@5.xx.xx is not compatible with this plugin."},{"fix":"Ensure new UnminifiedWebpackPlugin() is added to the plugins array and that optimization.minimize is enabled.","cause":"Plugin not properly configured or included in webpack plugins array.","error":"Output file 'library.js' not generated, only 'library.min.js' exists."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}