Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devServer public option in Webpack 5

In Webpack 4, I used to set the external network URL of the dev server as follows:

module.exports = {
  //...
  devServer: {
    public: 'myapp.test:80'
  }
};

In the Webpack 5 docs however, I can't find this option. How can I configure this?

like image 305
reynard80 Avatar asked Jun 25 '26 19:06

reynard80


1 Answers

I believe this has been removed in favor of client.webSocketURL.

module.exports = {
  devServer: {
    client: {
      webSocketURL: 'auto://myapp.test:80/ws'
    }
  }
}

From the Vue CLI documentation:

public, sockHost, sockPath, and sockPort options were removed in favor [of] client.webSocketURL option.

https://cli.vuejs.org/migrations/migrate-from-v4.html#vue-cli-service

like image 138
JeremyM4n Avatar answered Jun 28 '26 19:06

JeremyM4n



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!