Check out example codes for "htmlwebpackplugin". It will help you in understanding the concepts better.
Code Example 1
//installation
npm install --save-dev html-webpack-plugin
//configuration
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
entry: 'index.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'index_bundle.js'
},
plugins: [new HtmlWebpackPlugin({
template: "./index.html",
})]
};
Code Example 2
npm install html-webpack-plugin --save-dev
Learn ReactJs, React Native from akashmittal.com