Registry /
serialization / html-webpack-pug-plugin
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
HtmlWebpackPugPlugin
✓ import HtmlWebpackPugPlugin from 'html-webpack-pug-plugin';
✗ const { HtmlWebpackPugPlugin } = require('html-webpack-pug-plugin');
Default export, not named. Use import default or require with default property.
HtmlWebpackPugPlugin (CommonJS)
✓ const HtmlWebpackPugPlugin = require('html-webpack-pug-plugin');
✗ const { HtmlWebpackPugPlugin } = require('html-webpack-pug-plugin');
CommonJS require returns the constructor directly, not an object.
HtmlWebpackPlugin
✓ import HtmlWebpackPlugin from 'html-webpack-plugin';
✗ import HtmlWebpackPugPlugin from 'html-webpack-plugin';
GitHub README example uses ES modules; 'html-webpack-pug-plugin' must be added separately.
Basic webpack config using html-webpack-pug-plugin with a Pug template, generating a Pug output file.
// webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPugPlugin = require('html-webpack-pug-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/template.pug',
filename: 'index.pug',
minify: false
}),
new HtmlWebpackPugPlugin({
adjustIndent: false
})
]
};
Errors
Common errors & fixes
Error: Plugin could not be instantiated: HtmlWebpackPugPlugin is not a constructor
Using destructured require on a default-exported module (e.g., const { HtmlWebpackPugPlugin } = require('...'))
fixUse const HtmlWebpackPugPlugin = require('html-webpack-pug-plugin'); TypeError: Cannot read property 'options' of undefined
HtmlWebpackPugPlugin called before HtmlWebpackPlugin, or missing HtmlWebpackPlugin entirely
fixEnsure HtmlWebpackPlugin is added first in plugins array and is instantiated.
Error: HtmlWebpackPugPlugin: adjustIndent is not a function
Passing adjustIndent option incorrectly (e.g., as a function instead of boolean)
fixSet adjustIndent: true or false, not a function.
ModuleNotFoundError: Module not found: Error: Can't resolve 'pug'
Missing pug dependency if template uses pug but not installed
fixInstall pug: npm install --save-dev pug
Audit
Dependencies
html-webpack-pluginrequiredpeer dependency: provides the HTML generation that this plugin converts to Pug
webpackrequiredpeer dependency: required to run the plugin