Skip to content

Instantly share code, notes, and snippets.

@BTMPL
Forked from fidel95/webpack.config.js
Last active March 21, 2017 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BTMPL/e56cc2df3fefd13d02c4d769468b337d to your computer and use it in GitHub Desktop.
Save BTMPL/e56cc2df3fefd13d02c4d769468b337d to your computer and use it in GitHub Desktop.
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: './src/index.html',
filename: 'index.html',
inject: 'body'
})
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname,'./dist'),
filename: 'bundle.js'
},
module: {
rules: [
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ },
{
test: /\.css$/,
use: ['style-loader','css-loader']
},
{
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