Skip to content

Instantly share code, notes, and snippets.

@Dvisacker
Last active October 8, 2016 08:37
Show Gist options
  • Save Dvisacker/8d1f8deab54b3d8da3db86de7ec7745a to your computer and use it in GitHub Desktop.
Save Dvisacker/8d1f8deab54b3d8da3db86de7ec7745a to your computer and use it in GitHub Desktop.
JS Webpack Config Template
//Template of web.config.js gist
var HtmlWebpackPlugin = require('html-webpack-plugin')
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
template: __dirname + 'index.html',
filename: 'index.html',
inject: 'body'
});
module.exports = {
entry: './index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
module: {
loaders: [
{test: /\.css$/, exclude: /node_modules/, loader: 'style!css!' }
{test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"}
]
},
plugins: [HTMLWebpackPluginConfig]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment