@cnamts/vue-cli-plugin-proxy
Advanced tools
Comparing version 2.1.6 to 2.2.0
@@ -0,1 +1,5 @@ | ||
## [v2.2.0](https://github.com/assurance-maladie-digital/vue-cli-plugin-proxy/compare/v2.1.6...v2.2.0) (11-03-2019) | ||
* ✨ Add `enabled` option [#1](https://github.com/assurance-maladie-digital/vue-cli-plugin-proxy/pull/1) (thanks to [clemyan](https://github.com/clemyan)) | ||
## [v2.1.6](https://github.com/assurance-maladie-digital/vue-cli-plugin-proxy/compare/v2.1.5...v2.1.6) (02-10-2018) | ||
@@ -2,0 +6,0 @@ |
16
index.js
var proxy = require('http-proxy-middleware'); | ||
module.exports = (api, options) => { | ||
api.configureDevServer((app) => { | ||
app.use(proxy( | ||
options.pluginOptions.proxy.context, | ||
options.pluginOptions.proxy.options | ||
)); | ||
}); | ||
const opts = options.pluginOptions.proxy; | ||
if (opts && (opts.enabled === undefined || opts.enabled)) { | ||
api.configureDevServer((app) => { | ||
app.use(proxy( | ||
opts.context, | ||
opts.options | ||
)); | ||
}); | ||
} | ||
}; |
{ | ||
"name": "@cnamts/vue-cli-plugin-proxy", | ||
"version": "2.1.6", | ||
"version": "2.2.0", | ||
"description": "Provide all http-proxy-middleware options to vue-cli", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -43,3 +43,3 @@ <p align="center"> | ||
See the issue than initiated this plugin: [#2320](https://github.com/vuejs/vue-cli/issues/2320) | ||
See [the issue than initiated this plugin (#2320)](https://github.com/vuejs/vue-cli/issues/2320) | ||
@@ -61,2 +61,3 @@ ## As Easy as 1, 2, 3 | ||
proxy: { | ||
enabled: true, | ||
context: '', | ||
@@ -84,3 +85,4 @@ options: { | ||
proxy: { | ||
context: '/api', | ||
enabled: true, | ||
context: '/api', | ||
options: { | ||
@@ -102,3 +104,4 @@ target: 'http://www.example.org', | ||
proxy: { | ||
context: ['/**', '!/dist/**'], | ||
enabled: true, | ||
context: ['/**', '!/dist/**'], | ||
options: { | ||
@@ -114,2 +117,2 @@ target: 'http://127.0.0.1:8000', | ||
Vue CLI plugin proxy is licensed under a [MIT License](./LICENSE). | ||
Vue CLI Plugin Proxy is licensed under [MIT License](./LICENSE). |
Sorry, the diff of this file is not supported yet
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
11
12
114
1
14159