5

I have a VUE application and I need to run it on an external link not on localhost.

I tried to create a

vue.config.js

devServer: {
    host: 'http://my-testing-web-address.com',
    port: 8080,
    ...
}

and set the devserver, but still no changes

when I run

npm run serve

It says

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

It's any way to set up an external devserver?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Gabriela Dan
  • 61
  • 1
  • 4

3 Answers3

5
{
  module.exports = {
    devServer: {
      host: 'projectname.local'
    }
  }
}

Full details here: https://stevencotterill.com/snippets/vue-cli-using-a-custom-domain

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Andy
  • 59
  • 2
  • 11
4

In vue.config.js:

module.exports = {
  devServer: {
    disableHostCheck: true
  }   
}
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Kim Nyholm
  • 1,055
  • 1
  • 10
  • 19
  • Currently `disableHostCheck` does not seem to "exist" while using Vue "^2.7.14". Thank You anyway, I think it helped me discover the solution I presented. – kcpr Jun 28 '23 at 14:32
0

For me adding the similar entry to module.exports in "vue.config.js" helped:

devServer: {
  allowedHosts: ['(...).tunnelmole.com']
}
kcpr
  • 1,055
  • 1
  • 12
  • 28