react-config-tut: added HtmlWebpackPlugin plugin for deployment

This commit is contained in:
Begerad, Stefan 2021-09-09 14:37:55 -04:00
parent a5b0d54cee
commit 3616faa187
2 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,5 @@
</head>
<body>
<div id="root"></div>
<script src="./dist/bundle.js"></script>
</body>
</html>

View File

@ -1,4 +1,5 @@
var path = require('path');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
//tell Webpack to generate src maps
@ -40,4 +41,9 @@ module.exports = {
},
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve('./index.html'),
}),
]
};