Created
May 4, 2016 14:43
-
-
Save zaki-yama/8a3c03e9d595671c3b8e380bdedd467e to your computer and use it in GitHub Desktop.
webpack.config.js for React App
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 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