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?
Try using Ctrl-C instead. It allows the application to gracefully shut down.
The vue-cli-service serve command starts a dev server (based on webpack-dev-server) that comes with Hot-Module-Replacement (HMR) working out of the box.
@vue/cli-service-global is a package that allows you to run vue serve and vue build without any local dependencies. @vue/cli-service is a package that actually doing those vue serve and vue build , both @vue/cli-service-global and @vue/cli depend on it.
// 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With