Skip to content

Instantly share code, notes, and snippets.

@buglessir
Created January 10, 2019 08:56
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/cdb04b2b65d8d94a759bf8b0bcb9d3aa to your computer and use it in GitHub Desktop.
Save buglessir/cdb04b2b65d8d94a759bf8b0bcb9d3aa 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: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(png|jpg|gif)$/,
use: ['file-loader']
}
]
},
plugins: [HtmlWebpackPluginConfig]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment