Skip to content

Instantly share code, notes, and snippets.

@zaki-yama
Created May 4, 2016 14:43
Show Gist options
  • Save zaki-yama/8a3c03e9d595671c3b8e380bdedd467e to your computer and use it in GitHub Desktop.
Save zaki-yama/8a3c03e9d595671c3b8e380bdedd467e to your computer and use it in GitHub Desktop.
webpack.config.js for React App
const webpack = require('webpack');
module.exports = {
context: __dirname + '/src',
entry: {
javascript: './index.js',
html: './index.html'
},
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
// Configuration for dev server
devServer: {
contentBase: 'dist',
port: 3000
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query:{
presets: ['react', 'es2015', 'react-hmre']
}
},
{
test: /\.html$/,
loader: 'file?name=[path][name].[ext]'
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment