Chris G.
Chris G.

Reputation: 25964

webpack and react jsx - hot loading not working with docker container

Changed to: hot loading does not work in docker and it looks like it is a docker issue.

Following this: React with webpack or this React hot loader on local host machine they work fine and to me, they work the same - still I dont get why you would install React hot loader?

But running it in a container, updating/"hot loading" does not work in any of them. So this might be a question a docker expert?

Upvotes: 4

Views: 3987

Answers (3)

awe2m2n2s
awe2m2n2s

Reputation: 56

As described on GitHub, you can do this:

watchOptions: {
    poll: true
}

Or, in the package.json, instead of --watch do --watch --watch-poll.

Upvotes: 4

saul.shanabrook
saul.shanabrook

Reputation: 3168

If you are just looking for a proper file watching solution on a mac with Docker, check out docker-osx-dev. It uses boot2docker behind the scenes, but adds rsync support. I tried it and it works great for file changes.

Upvotes: 1

Chris G.
Chris G.

Reputation: 25964

I found a workaround; I have a reverse proxy(nginx) running in a container. The proxy forwards back to my main host computer(a Mac) on a port. This gives me hot loading and most important, I have no issues with cross domain as I have my database running in yet another container.

Upvotes: 0

Related Questions