Home >Web Front-end >JS Tutorial >What should I do if webpack cannot access localhost via IP address?

What should I do if webpack cannot access localhost via IP address?

php中世界最好的语言
php中世界最好的语言Original
2018-03-17 14:38:582032browse

This time I will bring you what to do if webpack cannot access localhost through IP address? , what are the precautions when dealing with webpack's inability to access localhost through IP address? The following is a practical case, let's take a look.

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 queries, add the parameter --host 0.0 when npm run dev .0.0 is enough.

The above article solves the problem that webpack cannot access localhost through IP address. This is all the content shared by the editor. I hope it can give you a reference, and I also hope that everyone will support Script Home.

Reference address: https://github.com/webpack/webpack-dev-server/issues/147

I believe I have read it You have mastered the method in the case of this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to call the parent component in a sub-component in ES6

What are the commonly used message boxes in JS

The above is the detailed content of What should I do if webpack cannot access localhost via 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