0

By default, Vue-CLI-service serves on HTTP 1.1. Is there any way to serve it on HTTP-2?

1 Answer 1

0

Vue CLI's devServer configuration is passed to the underlying Webpack, so you could set devServer.http2=true to enable HTTP2. Note that devServer.https=true is also needed for Vue CLI to use HTTPS (required for HTTP2 to work):

// vue.config.js
module.exports = {
  devServer: {
    https: true,
    http2: true,
  }
}

Despite Webpack's deprecation warnings for both the options above, this configuration actually works for the current version of Webpack (version 5.65.0) used by Vue CLI 5.0.0-rc.1. Switching to devServer.server=spdy without enabling devServer.https does not work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.