-
-
Save schatterjee4/7dada4a13baab3e3419bfbb95e8b370a 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 { resolve } = require('path'); | |
const webpack = require('webpack') | |
module.exports = { | |
entry: [ | |
//'react-hot-loader/patch', | |
// activate HMR for React | |
'webpack-dev-server/client?http://localhost:8080', | |
// bundle the client for webpack-dev-server | |
// and connect to the provided endpoint | |
'webpack/hot/only-dev-server', | |
// bundle the client for hot reloading | |
// only- means to only hot reload for successful updates | |
'./index.js' | |
// the entry point of our app | |
], | |
output: { | |
filename: 'bundle.js', | |
path: resolve(__dirname, 'dist'), | |
publicPath: '/' | |
// necessary for HMR to know where to load the hot update chunks | |
}, | |
context: resolve(__dirname, 'src'), | |
devServer: { | |
hot: true, | |
contentBase: resolve(__dirname, 'dist'), | |
publicPath: '/' | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js?$/, | |
use: [ | |
'react-hot-loader', | |
'babel-loader', | |
], | |
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