File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ yarn add @cnamts/vue-cli-plugin-proxy # OR npm install @cnamts/vue-cli-plugin-pr
5757module .exports = {
5858 pluginOptions: {
5959 proxy: {
60+ enabled: true ,
6061 context: ' ' ,
6162 options: {
6263 // ...
@@ -79,7 +80,8 @@ See [http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware#
7980module .exports = {
8081 pluginOptions: {
8182 proxy: {
82- context: ' /api' ,
83+ enabled: true ,
84+ context: ' /api' ,
8385 options: {
8486 target: ' http://www.example.org' ,
8587 changeOrigin: true
@@ -96,7 +98,8 @@ module.exports = {
9698module .exports = {
9799 pluginOptions: {
98100 proxy: {
99- context: [' /**' , ' !/dist/**' ],
101+ enabled: true ,
102+ context: [' /**' , ' !/dist/**' ],
100103 options: {
101104 target: ' http://127.0.0.1:8000' ,
102105 }
@@ -107,4 +110,4 @@ module.exports = {
107110
108111## License
109112
110- Vue CLI plugin proxy is licensed under a [ MIT License] ( ./LICENSE ) .
113+ Vue CLI plugin proxy is licensed under a [ MIT License] ( ./LICENSE ) .
Original file line number Diff line number Diff line change 11var proxy = require ( 'http-proxy-middleware' ) ;
22
33module . exports = ( api , options ) => {
4- api . configureDevServer ( ( app ) => {
5- app . use ( proxy (
6- options . pluginOptions . proxy . context ,
7- options . pluginOptions . proxy . options
8- ) ) ;
9- } ) ;
4+ const opts = options . pluginOptions . proxy
5+ if ( opts && ( opts . enabled === undefined || opts . enabled ) ) {
6+ api . configureDevServer ( ( app ) => {
7+ app . use ( proxy (
8+ opts . context ,
9+ opts . options
10+ ) ) ;
11+ } ) ;
12+ }
1013} ;
You can’t perform that action at this time.
0 commit comments