Provide all http-proxy-middleware options to vue-cli
npm install @deraw/vue-cli-plugin-proxy
width="280"
src="https://user-images.githubusercontent.com/10298932/59419196-af91f800-8dca-11e9-9ea8-de5567e9e471.png"
alt=""
>
This plugin is meant to provide all http-proxy-middleware options to vue-cli.
See the issue than initiated this plugin (#2320)
`` bash`
yarn add @deraw/vue-cli-plugin-proxyOR npm install @deraw/vue-cli-plugin-proxy
`js`
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: '',
options: {
// ...
}
}
}
}
See http-proxy-middleware for options object to pass to the plugin.
* 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'
}
}
}
}
Vue CLI Plugin Proxy is licensed under MIT License.