How to configure the domain name with webpack devServer, and use the domain name to access the local server without ip.

as the title: how to configure the domain name with webpack devServer, and use the domain name to access the local server without ip.


you can map any domain name to any IP by modifying the native HOSTS file. For example,

127.0.0.1    www.example.com

this resolves the www.example.com domain name to 127.0.0.1 .

The main way to implement

is to modify the hosts mentioned above.
can use SwitchHosts to modify


the Emperor is right. Just set your local IP to the domain name you want to configure in the HOSTS file. Then change host to your configured domain name in config.js.

Menu