Macil / browserify-hmr

Hot Module Replacement plugin for Browserify
MIT License
373 stars 26 forks source link

Access browserify-hmr across docker container. #39

Closed AMontagu closed 6 years ago

AMontagu commented 6 years ago

Hello I am trying to put my existing web application into a docker container for dev purpose.

Everything is working except the hot module replacement. I suppose it's because browserify for security reason bind to localhost only and in a docker container the ip change.

My docker configuration is good because I got a connection reset and not a connection refused.

This is my package.json scripts (I add the -u http://0.0.0.0:3123 options for testing without results):

"watchify": "watchify -vd -p browserify-hmr -u http://0.0.0.0:3123 -e src/frontend/main.js -o dist/build.js",
"serve": "cross-env DEBUG=web:* nodemon --ignore dist -e js server.js",
"dev": "cross-env NODE_ENV=dev npm-run-all --parallel lint watchify serve",

By reading the doc it my be a combination of the noServe and the -u options but not sur how to use this inside a docker container with my apps files in a docker volume.

AMontagu commented 6 years ago

Okay I was used the wrong option and in a wrong way.

The script that work:

"watchify": "watchify -vd -p [ browserify-hmr --hostname 0.0.0.0] -e src/frontend/main.js -o dist/build.js",