Giter VIP home page Giter VIP logo

Comments (4)

Macil avatar Macil commented on August 18, 2024

You need to use the h/hostname option. You'll probably want to use -h 0.0.0.0 to listen on all addresses instead of just localhost. This was a breaking change in 0.3.0. (This project is following semver. Major version updates, and minor version updates before 1.0.0 may contain breaking changes.)

Previously, the hostname and port were automatically inferred from the u/url option, but this was restrictive and didn't allow people to make the socket server listen on an address (like 0.0.0.0) that was different from what the client accessed. (#4)

from browserify-hmr.

serapath avatar serapath commented on August 18, 2024

Not sure if I understand you correct. As you can see above, I'm using

 "scripts": {
    "watch": "watchify source/index.js -p [ browserify-hmr -u http://$(my-local-ip):3123 ] -p ghostmodeify -t babelify -o public/browser/bundle.js -dv"
  }

I now updated to 0.3.1 again and changed my script to

 "scripts": {
    "watch": "watchify source/index.js -p [ browserify-hmr -h $(my-local-ip) ] -p ghostmodeify -t babelify -o public/browser/bundle.js -dv"
  }

but it's not working. If i switch $(my-local-ip) for 0.0.0.0 its working, but the problem is, that it breaks my workflow developing a cordova app on my mobile phone, because it needs to connect to the server that runs on my notebook instead of searching on localhost, so it was really nice to be able to use my-local-ip instead.

from browserify-hmr.

Macil avatar Macil commented on August 18, 2024

You still need the -u option. The -u option controls what URL is written into the bundle. The -h option controls what address the browserify-hmr socket server listens on. Previous versions automatically guessed the hostname based on the url, but 0.3.0 split them into separate options.

from browserify-hmr.

serapath avatar serapath commented on August 18, 2024

oh, ok. i see. I'll try that. thx

from browserify-hmr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.