@aquestsrl/html-webpack-dynamic-template-parameters-plugin

This plugin must be used after HtmlWebpackPlugin. Before HtmlWebpackPlugin generate the new html, this plugin update the template parameters checking basename of template file.

Usage no npm install needed!

<script type="module">
  import aquestsrlHtmlWebpackDynamicTemplateParametersPlugin from 'https://cdn.skypack.dev/@aquestsrl/html-webpack-dynamic-template-parameters-plugin';
</script>

README

html-webpack-dynamic-template-parameters-plugin

This plugin must be used after HtmlWebpackPlugin.
Before HtmlWebpackPlugin generate the new html, this plugin update the template parameters checking basename of template file.

Installation

yarn add @aquestsrl/html-webpack-dynamic-template-parameters-plugin -D

const HtmlWebpackDynamicTemplateParametersPlugin = require('@aquestsrl/HtmlWebpackDynamicTemplateParametersPlugin');

const config = {
  plugins: [
    ...,
    new HtmlWebpackPlugin({
      template: 'index.hbs',
      filename: 'index.html'
    }),
    new HtmlWebpackDynamicTemplateParametersPlugin({
       path: 'index.json',
       globalPath: 'global.json'
    }),
  ]
}