Created
March 21, 2017 03:26
-
-
Save fidel95/338569c49e1d78f0de563e4d3cf52313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { | |
loaders: [ | |
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ }, | |
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ } | |
], | |
rules: [ | |
{ | |
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