How to enable CORS on Vue CLI serve

15th February, 2020 1 min. read

Today I’ve learned how to enable CORS when using the local webserver of Vue-CLI during development.

Here the tip learned here. Just add or create the vue.config.js file with:

module.exports = {
  configureWebpack: {
    devServer: {
      headers: { 'Access-Control-Allow-Origin': '*' }
    }
  }
}

Spotted a typo or (likely) a grammar error? Send a pull request.