Latest vue-cli scaffolding configuration local ip access failed

the old version used before maps IP to a real domain name in the local host file, and then changes host to a domain name in dev-service.js to start the project locally through the domain name. Now you have downloaded an up-to-date scaffolding and changed the value of host to, npm run dev to report an error directly. Has anyone encountered this problem and how to solve it? Thank you

Mar.03,2021

how is vue.config.js configured?


does anyone know how to solve this problem


webpack for security reasons, host access is not allowed by default.
solve

"scripts": {
    "build": "webpack --config webpack.prod.config.js",
    "dev": "webpack-dev-server --disable-host-check --inline --progress --config webpack.dev.config.js"
  },

add-- disable-host-check

Menu