electron-userland / electron-compilers

DEPRECATED: Compiler implementations for electron-compile
35 stars 55 forks source link

react-hot-reload breaks app completely in monorepo #83

Open walleXD opened 6 years ago

walleXD commented 6 years ago

Hey all,

I am working on a project which is in a monorepo and the react components are in a separate package which are all connected by lerna. But if I use it with react-hot-loader it totally borks electron-compile & it complains:

Uncaught Error: Couldn't find preset "react-hot-loader" relative to directory "/Volumes/*/universal-react/packages/components/src"

Any idea how to fix this? It seems to be looking at the node_modules folder in the components package rather than the actual project's node_module folder

Thanks a bunch....

mnaamani commented 6 years ago

@walleXD This fixes the issue https://github.com/electron-userland/electron-compilers/pull/73 Although it has been merged but hasn't made it into a release yet.

The root cause is the react-hot-loader npm package really needs to be published as babel-plugin-react-hot-loader

I was thinking of publishing an npm package myself with this name. I'll try it out and report back. Ideally we can ask the maintainer of react-hot-loader to publish the package with that name.

mnaamani commented 6 years ago

It would seem that adding the "next" branch version of react-hot-loader doesn't break. Can you confirm this?