diff --git a/src/index.js b/src/index.js index b1e87f314..a2d6923d9 100644 --- a/src/index.js +++ b/src/index.js @@ -14,3 +14,6 @@ ReactDOM.render( , document.getElementById('root'), ); + +// hot module replacement during development +if (module.hot) module.hot.accept(); diff --git a/src/redux/store.js b/src/redux/store.js index 5383b535a..f853f25d8 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -1,5 +1,6 @@ import { applyMiddleware, createStore } from 'redux'; import logger from 'redux-logger'; +import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; import rootReducer from './rootReducer'; @@ -9,9 +10,8 @@ if (process.env.NODE_ENV === 'development') { middlewares.push(logger); } -const store = createStore( - rootReducer, +const store = createStore(rootReducer, composeWithDevTools( applyMiddleware(...middlewares), -); +)); export default store; diff --git a/webpack.config.js b/webpack.config.js index 289b0ca30..2182956cb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -24,7 +24,12 @@ module.exports = { { test: /\.(css|scss|sass)$/, use: [ - MiniCssExtractPlugin.loader, + { + loader: MiniCssExtractPlugin.loader, + options: { + hmr: true + } + }, { loader: 'css-loader', },