Registry / devops / html-webpack-template

html-webpack-template

JSON →
library6.2.0jsnpmunverified

html-webpack-template v6.2.0 is an EJS template for html-webpack-plugin that extends the default template with built-in options for app mount points, external scripts, meta tags, Google Analytics, and more. It requires html-webpack-plugin 2.x or 3.x (peer dependency) and was last released in 2016. It is in maintenance mode as the html-webpack-plugin ecosystem has evolved. Key differentiators: no need to write a custom index.html; supports appMountId, window, devServer, and other config options directly in the plugin configuration.

npm install html-webpack-template
INSTALL
IMPORT
SIG · HTML-WEBPACK-TEMPL
H
html-webpack-template
devopsjavascriptv6.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const template = require('html-webpack-template');
import template from 'html-webpack-template';
Package is CommonJS; ESM import may work in some bundlers but not guaranteed.
template string path
template: 'node_modules/html-webpack-template/index.ejs'
template: require.resolve('html-webpack-template')
Using require() is the documented method; string path also works but is brittle.
HtmlWebpackPlugin configuration
new HtmlWebpackPlugin({ inject: false, template: require('html-webpack-template') })
new HtmlWebpackPlugin({ inject: true, template: 'html-webpack-template' })
Must set inject: false because the template injects assets itself.

Shows basic usage with HtmlWebpackPlugin, required inject:false, and optional appMountId, window config, mobile meta, and lang attribute.

const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackTemplate = require('html-webpack-template'); module.exports = { entry: './src/index.js', plugins: [ new HtmlWebpackPlugin({ inject: false, template: HtmlWebpackTemplate, appMountId: 'app', window: { processEnv: { NODE_ENV: JSON.stringify(process.env.NODE_ENV ?? 'development') } }, mobile: true, lang: 'en-US' }) ] };
Debug
Known issues
breakingPackage requires html-webpack-plugin v2.x or v3.x; does not work with v4+.
fix
Use html-webpack-plugin@3.x or migrate to a newer template like html-webpack-plugin's built-in or @dr.pogodin/react-helmet.
affects: >=6.0.0
deprecatedPackage has not been updated since 2016; no support for html-webpack-plugin v4+ features.
fix
Consider using html-webpack-plugin's default template or alternatives like html-webpack-plugin/lib/loader.js.
affects: >=6.0.0
gotchaMust set inject: false in HtmlWebpackPlugin options, otherwise assets are injected twice.
fix
Explicitly set inject: false in the constructor.
affects: >=3.0.0
gotchaOptions like appMountId, appMountIds, and window are case-sensitive; misspelling them results in silent failures.
fix
Double-check option names from documentation.
affects: *
Errors
Common errors & fixes
ERROR in Template execution failed: ReferenceError: htmlWebpackPlugin is not defined
html-webpack-plugin version mismatch (v4+ changes variable names).
fix
Downgrade to html-webpack-plugin@3.x or use a compatible template.
Module not found: Error: Can't resolve 'html-webpack-template'
Missing npm install or incorrect path in template option.
fix
Run npm install html-webpack-template --save-dev and use require('html-webpack-template') instead of a string.
Upgrade
Version history
6.2.0latest on npm
Audit
Dependencies
html-webpack-pluginrequiredpeer dependency; template is used as input to this plugin
Agent activity
6 hits · last 30 days
node
6
Resources
html-webpack-template — npm install html-webpack-template · libregistry