Skip to content

Proxy root url #3588

@padinko

Description

@padinko

What problem does this feature solve?

devServer.proxy cannot be used to proxy root requests now. It is very usefull when your vue app is under some php project.

What does the proposed API look like?

Webpack DevServer can be set to proxy root requests too: https://webpack.js.org/configuration/dev-server/#devserverproxy
with this config:

module.exports = {
  //...
  devServer: {
    index: '', // specify to enable root proxying
    host: '...',
    contentBase: '...',
    proxy: {
      context: () => true,
      target: 'http://localhost:1234'
    }
  }
};

but now this config throw error:

When `proxy` in package.json is an object, each `context` object must have a `target` property specified as a url string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions