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

Webpack cannot access localhost through IP address

小云云
Release: 2018-02-23 09:14:50
Original
1734 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template