Home > Web Front-end > JS Tutorial > body text

How to deal with the vue+webpack+myproject project that cannot be accessed by ip

php中世界最好的语言
Release: 2018-06-15 14:17:15
Original
1143 people have browsed it

This time I will show you how to deal with the vue webpack myproject project whose IP cannot be accessed. What are the precautions when dealing with the vue webpack myproject project whose IP cannot be accessed? The following is a practical case, let's take a look.

Problem

vue init webpack myproject The project built using localhost or 127.0.0.1 can be accessed normally, but switching to the local ip does not work

Solution

Append the following code to webpack.dev.conf.js

const HOST = process.env.HOST || '0.0.0.0';
Copy after login

Restart

npm run dev
Copy after login

Just reopen it

I believe you have already read the case in this article After mastering the method, please pay attention to other related articles on the php Chinese website for more exciting content!

Recommended reading

How to use webpack vue environment LAN

How to operate nodejs to encrypt passwords

The above is the detailed content of How to deal with the vue+webpack+myproject project that cannot be accessed by ip. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!