Skip to content

Instantly share code, notes, and snippets.

@thanapongp
Created September 7, 2019 07:43
Show Gist options
  • Select an option

  • Save thanapongp/8f817a1884ed8196b5765b43f9114955 to your computer and use it in GitHub Desktop.

Select an option

Save thanapongp/8f817a1884ed8196b5765b43f9114955 to your computer and use it in GitHub Desktop.
webpack.config.js with HtmlWebpackPlugin
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/js/main.js',
mode: 'development',
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html'
})
],
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist')
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment