{"id":20118,"library":"html-webpack-template","title":"HTML Webpack Template","description":"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.","status":"maintenance","version":"6.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/jaketrent/html-webpack-template","tags":["javascript","webpack","template","html-webpack-plugin","index.html","index.ejs"],"install":[{"cmd":"npm install html-webpack-template","lang":"bash","label":"npm"},{"cmd":"yarn add html-webpack-template","lang":"bash","label":"yarn"},{"cmd":"pnpm add html-webpack-template","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; template is used as input to this plugin","package":"html-webpack-plugin","optional":false}],"imports":[{"note":"Package is CommonJS; ESM import may work in some bundlers but not guaranteed.","wrong":"import template from 'html-webpack-template';","symbol":"default","correct":"const template = require('html-webpack-template');"},{"note":"Using require() is the documented method; string path also works but is brittle.","wrong":"template: require.resolve('html-webpack-template')","symbol":"template string path","correct":"template: 'node_modules/html-webpack-template/index.ejs'"},{"note":"Must set inject: false because the template injects assets itself.","wrong":"new HtmlWebpackPlugin({ inject: true, template: 'html-webpack-template' })","symbol":"HtmlWebpackPlugin configuration","correct":"new HtmlWebpackPlugin({ inject: false, template: require('html-webpack-template') })"}],"quickstart":{"code":"const HtmlWebpackPlugin = require('html-webpack-plugin');\nconst HtmlWebpackTemplate = require('html-webpack-template');\n\nmodule.exports = {\n  entry: './src/index.js',\n  plugins: [\n    new HtmlWebpackPlugin({\n      inject: false,\n      template: HtmlWebpackTemplate,\n      appMountId: 'app',\n      window: {\n        processEnv: {\n          NODE_ENV: JSON.stringify(process.env.NODE_ENV ?? 'development')\n        }\n      },\n      mobile: true,\n      lang: 'en-US'\n    })\n  ]\n};","lang":"javascript","description":"Shows basic usage with HtmlWebpackPlugin, required inject:false, and optional appMountId, window config, mobile meta, and lang attribute."},"warnings":[{"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.","message":"Package requires html-webpack-plugin v2.x or v3.x; does not work with v4+.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Consider using html-webpack-plugin's default template or alternatives like html-webpack-plugin/lib/loader.js.","message":"Package has not been updated since 2016; no support for html-webpack-plugin v4+ features.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Explicitly set inject: false in the constructor.","message":"Must set inject: false in HtmlWebpackPlugin options, otherwise assets are injected twice.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Double-check option names from documentation.","message":"Options like appMountId, appMountIds, and window are case-sensitive; misspelling them results in silent failures.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Downgrade to html-webpack-plugin@3.x or use a compatible template.","cause":"html-webpack-plugin version mismatch (v4+ changes variable names).","error":"ERROR in   Template execution failed: ReferenceError: htmlWebpackPlugin is not defined"},{"fix":"Run npm install html-webpack-template --save-dev and use require('html-webpack-template') instead of a string.","cause":"Missing npm install or incorrect path in template option.","error":"Module not found: Error: Can't resolve 'html-webpack-template'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}