How do I disable running an app on the local network when using vue-cli?
Asked Answered
P

1

17

When I run a vue-cli project I see this:

DONE  Compiled successfully in 5778ms

  App running at:
  - Local:   http://localhost:8080/ 
  - Network: http://192.168.178.9:8080/

  Note that the development build is not optimized.
  To create a production build, run npm run build.

I don’t want my app to be running on the local network, only local host. How do I turn the local network part off?

Plod answered 16/10, 2018 at 6:44 Comment(0)
C
30
// vue.config.js
{
  devServer: {
    host: "localhost"
  }
}

Setting host to "localhost" will disable network access in the webpack-dev-server.

App running at:
 - Local:   http://localhost:8080/
 - Network: unavailable
Crean answered 16/10, 2018 at 7:18 Comment(3)
However, when I do not even have this config file in my project, in one machine it works well but in another machine it reports network unavailable.Amble
@K.Symbol seems like your problem is vice-versa. It seems like you would like be able to access the application on the network but the question was about blocking the ability to access the application on the network :)Untimely
I have this problem with network unavailable and I want to fix it. How can I do it? I don't have the config.js fileBetancourt

© 2022 - 2024 — McMap. All rights reserved.