This plugin is meant to provide all http-proxy-middleware options to vue-cli.
See the issue than initiated this plugin: #2320
yarn add @cnamts/vue-cli-plugin-proxy # OR npm install @cnamts/vue-cli-plugin-proxy
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
context: '',
options: {
// ...
}
}
}
}
See http-proxy-middleware for options
object to pass to the plugin.
- First example of the docs:
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
context: '/api',
options: {
target: 'http://www.example.org',
changeOrigin: true
}
}
}
}
- v1.0.0 default:
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
context: ['/**', '!/dist/**'],
options: {
target: 'http://127.0.0.1:8000',
}
}
}
}
Vue CLI plugin proxy is licensed under a MIT License.