How to get access to webpack-dev-server from devices in local network?

后端 未结 5 508
北海茫月
北海茫月 2020-12-04 06:05

There is some webpack dev server config (it\'s part of the whole config):

config.devServer = {
  contentBase: \'./\' + (options.publicFolder ? options.public         


        
5条回答
  •  忘掉有多难
    2020-12-04 06:23

    (If you're on a Mac and network like mine.)

    Run webpack-dev-server with --host 0.0.0.0 — this lets the server listen for requests from the network, not just localhost.

    Find your computer's address on the network. In terminal, type ifconfig and look for the en1 section or the one with something like inet 192.168.1.111

    In your mobile device on the same network, visit http://192.168.1.111:8080 and enjoy hot reloading dev bliss.

提交回复
热议问题