L
L
LionG2021-04-28 09:04:43
webpack
LionG, 2021-04-28 09:04:43

How to change host in webpack's openPage config (opens 0.0.0.0)?

I start the server on all available addresses so that I can log in from other devices via LAN:
host: '0.0.0.0'

But now, when I start the webpack, it opens pages from openPage by default, indicating host 0.0.0.0, which naturally does not work ( 0.0.0.0:777/index.html ). This is not critical and I can manually change the address to the host I need, but it would be more convenient to immediately open through localhost.

As an option, register the IP of the LAN, but I do not want to bind the config to the IP of a specific network. And under some circumstances, you generally need to broadcast to several networks (for example, LAN and VPN).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LionG, 2021-04-28
@LionG

It should work in webpack4 :
public: 'localhost:777'
UPD in wp5 also works, at first I forgot to specify the port in the address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question