Home  >  Article  >  Web Front-end  >  Webpack cannot access localhost through IP address

Webpack cannot access localhost through IP address

小云云
小云云Original
2018-02-23 09:14:501700browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn