Home > Article > Web Front-end > How to deal with the vue+webpack+myproject project that cannot be accessed by ip
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';
Restart
npm run dev
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!