Home > Article > Web Front-end > Solve the problem that webpack cannot access 127.0.0.1
Below I will share with you an article that solves the problem that webpack cannot access localhost through IP address. It has a good reference value and I hope it will be helpful to everyone.
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, You need to save the QR code through the IP address and then scan it with your mobile phone to access. 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 what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to dynamically add and delete data in AngularJS?
Detailed interpretation of elements, components, instances and nodes in React
How to dynamically add and delete div methods in angularJS
The above is the detailed content of Solve the problem that webpack cannot access 127.0.0.1. For more information, please follow other related articles on the PHP Chinese website!