File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
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
57
57
module .exports = {
58
58
pluginOptions: {
59
59
proxy: {
60
+ context: ' ' ,
60
61
options: {
61
62
// ...
62
63
}
@@ -67,7 +68,42 @@ module.exports = {
67
68
68
69
### You're done! 🎉
69
70
70
- See [ http-proxy-middleware] ( https://www.npmjs.com/package/http-proxy-middleware#example ) for ` options ` object to pass to the plugin.
71
+ See [ http-proxy-middleware] ( https://www.npmjs.com/package/http-proxy-middleware#tldr ) for ` options ` object to pass to the plugin.
72
+
73
+ #### Object examples
74
+
75
+ * First example of the docs:
76
+
77
+ ``` js
78
+ // vue.config.js
79
+ module .exports = {
80
+ pluginOptions: {
81
+ proxy: {
82
+ context: ' /api' ,
83
+ options: {
84
+ target: ' http://www.example.org' ,
85
+ changeOrigin: true
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ * v1.0.0 default:
93
+
94
+ ``` js
95
+ // vue.config.js
96
+ module .exports = {
97
+ pluginOptions: {
98
+ proxy: {
99
+ context: [' /**' , ' !/dist/**' ],
100
+ options: {
101
+ target: ' http://127.0.0.1:8000' ,
102
+ }
103
+ }
104
+ }
105
+ }
106
+ ```
71
107
72
108
## License
73
109
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ var proxy = require('http-proxy-middleware');
2
2
3
3
module . exports = api => {
4
4
api . configureDevServer ( ( app ) => {
5
- app . use ( proxy ( projectOptions . pluginOptions . proxy ) ) ;
5
+ app . use ( proxy ( projectOptions . pluginOptions . proxy . context , projectOptions . pluginOptions . proxy . options ) ) ;
6
6
} ) ;
7
7
} ;
You can’t perform that action at this time.
0 commit comments