parched-hmr
Adds support for hot module replacement to parched-tasks-webapp
.
Getting Started
You will need to tell parched-tasks-webapp
that your bundles have HMR
support:
Parched
Using with React
There are two parts to supporting hot loading with React:
1. Set up the front end
This is a hypothetical app/scripts/index.js
:
// This needs to be first ReactDOM if modulehot modulehotaccept
2. Install and configure needed dependencies
This will work with Babel, or TypeScript, or Babel + TypeScript.
npm install --save-dev parched-react-hot-loader
Parched
Note for Babel users:
I am not sure what this changes, but you can skip
parched-react-hot-loader
and addreact-hot-loader/babel
to your Babel plugins.npm install --save-dev parched-babel babel-preset-reactmv .babelrc .babelrc~cat <<-EOF > .babelrc{"presets": ["react"],"plugins": ["react-hot-loader/babel"]}EOF