https://github.com/deraw/vue-cli-plugin-proxy
🔌 Provide all http-proxy-middleware options to vue-cli
https://github.com/deraw/vue-cli-plugin-proxy
http-proxy-middleware vue-cli
Last synced: 8 months ago
JSON representation
🔌 Provide all http-proxy-middleware options to vue-cli
- Host: GitHub
- URL: https://github.com/deraw/vue-cli-plugin-proxy
- Owner: deraw
- License: mit
- Created: 2018-10-02T00:05:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T07:15:49.000Z (about 4 years ago)
- Last Synced: 2025-08-05T05:48:35.861Z (8 months ago)
- Topics: http-proxy-middleware, vue-cli
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 11
- Watchers: 4
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Vue CLI proxy plugin
This plugin is meant to provide all http-proxy-middleware options to vue-cli.
## Issue
See [the issue than initiated this plugin (#2320)](https://github.com/vuejs/vue-cli/issues/2320)
## Installation
``` bash
yarn add @deraw/vue-cli-plugin-proxy
# OR npm install @deraw/vue-cli-plugin-proxy
```
## Usage
```js
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: '',
options: {
// ...
}
}
}
}
```
## Options
See [http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware#tldr) for `options` object to pass to the plugin.
### Object examples
* First example of the docs:
```js
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: '/api',
options: {
target: 'http://www.example.org',
changeOrigin: true
}
}
}
}
```
* v1.0.0 default:
```js
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: [
'/**',
'!/dist/**'
],
options: {
target: 'http://127.0.0.1:8000'
}
}
}
}
```
## License
Vue CLI Plugin Proxy is licensed under [MIT License](./LICENSE).