Giter VIP home page Giter VIP logo

Comments (4)

Macil avatar Macil commented on September 28, 2024

Is there a reason that you can't specify your IP/hostname with the -u option? Are you listening on a different IP+port than your VM is trying to connect to? It seems like I should separate those to separate options then.

from browserify-hmr.

kentor avatar kentor commented on September 28, 2024

I could, but it'd be inconvenient if I want to access the bundle locally. Say I want to access the websocket locally (via localhost:3123) and in the VM (via 10.0.2.2:3123) at the same time without killing the watchify process. Hmm Another option is to specify the hostname through a query param on the bundle maybe.

from browserify-hmr.

Macil avatar Macil commented on September 28, 2024

I'm going to split up the -u option so there's a separate option (-l/listen?) for controlling the IP+port is listened on because that doesn't always match up with -u. Then I'll add a function for changing the update mode and settings at runtime. Something like

module.hot.setUpdateMode("websocket", {url: "http://10.0.2.2:3123"});

Going a little further, I'll add a "none" update mode so that the bundle can be started as or switched to not doing any updating at all. Hm, right now, the socket.io-client dependency is only brought in if the -m/mode flag is set to "websocket". I'll need to add an option to allow the dependency to be brought in even if the mode isn't set to it so it can be switched to at runtime. I could add an option so a list of desired modes to support can be passed so that browserify-hmr makes sure to pull in the right dependencies for all of them so they can be switched to at runtime.

from browserify-hmr.

kentor avatar kentor commented on September 28, 2024

Thanks a lot! 👍 It's working great. Definitely a feature that is missing from webpack's hmr

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.