From 20615400cfd2cb672c8a516691efb4de9d86caa5 Mon Sep 17 00:00:00 2001
From: Nick Fitzgerald <fitzgen@gmail.com>
Date: Thu, 23 Aug 2018 14:19:00 -0700
Subject: [PATCH] Ensure that `index.html` is bundled into `dist`

This is necessary for our "Production and Deployment" chapter of the book.
---
 package.json      | 3 ++-
 webpack.config.js | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index c731113..94c3492 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,7 @@
     "hello-wasm-pack": "^0.1.0",
     "webpack": "^4.16.3",
     "webpack-cli": "^3.1.0",
-    "webpack-dev-server": "^3.1.5"
+    "webpack-dev-server": "^3.1.5",
+    "copy-webpack-plugin": "^4.5.2"
   }
 }
\ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
index f15a055..80ad814 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,3 +1,4 @@
+const CopyWebpackPlugin = require("copy-webpack-plugin");
 const path = require('path');
 
 module.exports = {
@@ -7,4 +8,7 @@ module.exports = {
     filename: "bootstrap.js",
   },
   mode: "development",
+  plugins: [
+    new CopyWebpackPlugin(['index.html'])
+  ],
 };
-- 
GitLab