Open MSKhodadady opened 3 years ago
I upgraded parcel from 2.0.0-beta.2
to 2.0.0-beta.3.1
, and now the hot module replacement works 😃, but not hot reload 😶.
Wrote in doc, the hot reload works by default and If we add this lines to code 👇, now the hot reload works.
if (module.hot) {
module.hot.accept();
}
But now in my project, either this lines exists or not, the HMR works. This is not problem for me, but I think it is misbehavior, based on documentation.
Thank you very much.
can you tell me where did u push
if (module.hot) { module.hot.accept(); }
I pushed it in the App.js file and it's not worked :((
I push it in the main.js
file, where I called the ReactDOM.render
, after it.
🐛 bug report
I installed parcel v2 in my electron/react/ts project. Parcel runs correctly and if I save a file, the parcel rebuilds but the page in the electron doesn't reload automatically. I mean, the parcels rebuilds but the page in the electron (chromium) doesn't. The project's bundler previously was webpack, but I installed parcel v2 for easier hmr config.
🎛 Configuration (.babelrc, package.json, cli command)
package.json
Note that
typescript
was installed for using with webpack, and wasn't used with parcel..postcssrc.json
main.html
main.tsx
🤔 Expected Behavior
If I save a file, the parcel should rebuild and the page in electron (chromium) should reload.
😯 Current Behavior
The parcel rebuilds, but the page in electron (chromium) didn't reload.
💁 Possible Solution
I cannot find any possible solution, because it hasn't any error shown. Just not works :)
🔦 Context
I tried to have parcel's hot reload and hot module replace works with my electron renderer process that was written in React and Typescript.
💻 Code Sample
🌍 Your Environment