var webpack = require('webpack');
module.exports = {
entry: ['react-hot-loader/patch', './src/index.js'] ,
output: {
path: __dirname + '/public/',
filename: 'bundle.js'
},
devServer: {
hot: true, //컴포넌트가 수정 될 경우 그 수정된 부분만 리로드 해주는 부분 모듈 리로딩(“Hot Module Reloading”) 옵션
inline: true, //전체 페이지에 대한 실시간 리로딩(“Live Reloading”) 옵션
host: '0.0.0.0', //서버를 listen 할 주소
port: 4000, //포트
contentBase: __dirname + '/public/', //index 파일의 위치
},
module:{
loaders: [
{
test: /.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
cacheDirectory: true,
presets: ['es2015', 'react'],
plugins: ["react-hot-loader/babel"]
}
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};