Skip to content
Permalink
Browse files

configure html-webpack-plugin

create an index.html template and add the plugin to the webpack config
  • Loading branch information...
nicoqh committed Jun 3, 2019
1 parent d12b8de commit bca9256c7a71a6b1cab20760a828cf6d99e96d9d
Showing with 19 additions and 0 deletions.
  1. +9 −0 src/index.html
  2. +10 −0 webpack.config.js
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Boilerplate!</title>
</head>
<body>
</body>
</html>
@@ -1,4 +1,5 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

// We'll refer to our source and dist paths frequently, so let's store them here
const PATH_SOURCE = path.join(__dirname, './src');
@@ -73,5 +74,14 @@ module.exports = env => {
}
],
},

plugins: [
// This plugin will generate an HTML5 file that imports all our Webpack
// bundles using <script> tags. The file will be placed in `output.path`.
// https://github.com/jantimon/html-webpack-plugin
new HtmlWebpackPlugin({
template: path.join(PATH_SOURCE, './index.html'),
}),
],
};
};

0 comments on commit bca9256

Please sign in to comment.
You can’t perform that action at this time.