{"id":20215,"library":"mini-html-webpack-plugin","title":"mini-html-webpack-plugin","description":"A lightweight alternative to html-webpack-plugin for webpack 4 and 5, automating CSS and JS asset path injection into HTML templates. Current stable version 3.1.3 (October 2020) with no active development since. Supports multi-page setups via chunks, custom template functions, and HTML minification. Unlike html-webpack-plugin, it does not support plugins for html-webpack-plugin, making it simpler but less extensible. Written in TypeScript with bundled type definitions.","status":"maintenance","version":"3.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/styleguidist/mini-html-webpack-plugin","tags":["javascript","webpack","html","template","typescript"],"install":[{"cmd":"npm install mini-html-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add mini-html-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add mini-html-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, >=4","package":"webpack","optional":true}],"imports":[{"note":"CommonJS require extracts named export; default import was removed in v3.0.5.","wrong":"const MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin');","symbol":"MiniHtmlWebpackPlugin","correct":"const { MiniHtmlWebpackPlugin } = require('mini-html-webpack-plugin');"},{"note":"ESM named export, not default.","wrong":"import generateAttributes from 'mini-html-webpack-plugin';","symbol":"generateAttributes","correct":"import { generateAttributes } from 'mini-html-webpack-plugin';"},{"note":"Same as above; both named exports.","wrong":"const generateCSSReferences = require('mini-html-webpack-plugin').generateCSSReferences;","symbol":"generateCSSReferences","correct":"import { generateCSSReferences } from 'mini-html-webpack-plugin';"}],"quickstart":{"code":"const { MiniHtmlWebpackPlugin } = require('mini-html-webpack-plugin');\nconst webpack = require('webpack');\n\nconst compiler = webpack({\n  entry: './index.js',\n  output: {\n    path: __dirname + '/dist',\n    filename: 'bundle.js',\n  },\n  plugins: [\n    new MiniHtmlWebpackPlugin({\n      context: { title: 'My App' },\n      chunks: ['main']\n    }),\n  ],\n});\n\ncompiler.run((err, stats) => {\n  if (err) console.error(err);\n  console.log(stats.toString({ colors: true }));\n});","lang":"javascript","description":"Basic setup with MiniHtmlWebpackPlugin: define webpack configuration, add plugin, run compiler."},"warnings":[{"fix":"Switch from default import/require to named export: const { MiniHtmlWebpackPlugin } = require(...)","message":"Drop default export to fix CommonJS (v3.0.5)","severity":"breaking","affected_versions":">=3.0.5"},{"fix":"Upgrade to v3.1.0+ for webpack 5 support","message":"Webpack 5 compatibility: emit hook change","severity":"breaking","affected_versions":">=3.1.0"},{"fix":"Consider forking or switching to html-webpack-plugin if more features are needed","message":"No updates since 2020; package is in maintenance mode","severity":"deprecated","affected_versions":"all"},{"fix":"Do not use those plugins; implement custom templates instead","message":"Does not work with html-webpack-plugin plugins (e.g., html-webpack-harddisk-plugin)","severity":"gotcha","affected_versions":"all"},{"fix":"Use Node 10+","message":"Requires Node >=10","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":"npm install mini-html-webpack-plugin","cause":"Package not installed","error":"Cannot find module 'mini-html-webpack-plugin'"},{"fix":"Use const { MiniHtmlWebpackPlugin } = require('mini-html-webpack-plugin');","cause":"Using default require instead of named export","error":"MiniHtmlWebpackPlugin is not a constructor"},{"fix":"Use import { MiniHtmlWebpackPlugin } from 'mini-html-webpack-plugin';","cause":"Using default import in ESM context","error":"TypeError: MiniHtmlWebpackPlugin is not a constructor"},{"fix":"Update to mini-html-webpack-plugin >=3.1.0","cause":"Using webpack 5 with plugin version <3.1.0","error":"Error: Hook not found: emit"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}