Last active
February 10, 2018 06:49
-
-
Save kantologist/557a47a0c09adc53c6d64ed51234effd to your computer and use it in GitHub Desktop.
webpack config file for hacking react http://www.hackingwithreact.com/read/1/1/begin-at-the-beginning-chapter-one
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
// webpack config file for hacking react http://www.hackingwithreact.com/read/1/1/begin-at-the-beginning-chapter-one | |
const { resolve } = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: [ | |
'webpack-dev-server/client?http://localhost:8080', | |
'webpack/hot/only-dev-server', | |
'./index.js' | |
], | |
output: { | |
path: resolve(__dirname + '/dist'), | |
publicPath: '/', | |
filename: 'bundle.js' | |
}, | |
context: resolve(__dirname + '/src'), | |
devServer: { | |
contentBase:resolve( __dirname + '/dist'), | |
hot: true | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js?$/, | |
use: [ | |
'react-hot-loader/webpack', | |
'babel-loader?presets[]=react', | |
], | |
exclude: /node_modules/ | |
}, | |
], | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin() | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment