How to add a second file for HtmlWebPackPlugin in WebPack?

  html-webpack-plugin, javascript, webpack

I’m trying to add in a second file to be output to my /dist folder. The build fails when I run webpack.

Any ideas on what I might be doing wrong?

const HtmlWebPackPlugin = require("html-webpack-plugin");

module.exports = {
  plugins: [
    new HtmlWebPackPlugin({
      template: "./src/template.cfm",
      filename: "index.cfm",
      minify: false,
    }),
    new HtmlWebPackPlugin({
      myPageHeader: "Help",
      template: "./src/help.html",
      filename: "help.html"
    })
  ]
};

Source: Ask Javascript Questions

LEAVE A COMMENT