Home >Web Front-end >JS Tutorial >Webpack cannot access localhost through IP address
1. Problem description:
Today, I used webpack (v1.14.0) to configure local services. In order to preview the development effect on the mobile terminal, I need to save the QR code through the IP address and scan it with my mobile phone to access it. But found that localhost cannot be accessed through ip.
2. Solution:
After multiple inquiries, just add the parameter --host 0.0.0.0 when npm run dev.
The above is the detailed content of Webpack cannot access localhost through IP address. For more information, please follow other related articles on the PHP Chinese website!