Hum4n01d
Hum4n01d

Reputation: 1370

How to use Hot Module Replacement with Electron

I’d like to use HMR with my React Electron app. How would I do that? Do I need web pack? How do I integrate it with Electron?

Upvotes: 2

Views: 2313

Answers (1)

user5183133
user5183133

Reputation:

You use a webpack config just like you would with a normal web app.

The settings depend on wether you are using react-hot-loader 2 or 3 (beta)

You then set the src attribute in your index.html file to wherever your webpack dev server is serving the bundle from. Usually: localhost:8080/bundlename.js

Here is the walkthrough for react-hot-loader 2: http://gaearon.github.io/react-hot-loader/getstarted/

Upvotes: 4

Related Questions