Skip to content

Instantly share code, notes, and snippets.

@buglessir
Created January 7, 2019 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buglessir/3272c9e0ab5dd3cb7ba2c5c729797e17 to your computer and use it in GitHub Desktop.
Save buglessir/3272c9e0ab5dd3cb7ba2c5c729797e17 to your computer and use it in GitHub Desktop.
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'src/index.html')
});
module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'build')
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [HtmlWebpackPluginConfig]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment