Skip to content

deraw/vue-cli-plugin-proxy

Repository files navigation

Vue CLI proxy plugin

This plugin is meant to provide all http-proxy-middleware options to vue-cli.

NPM Version NPM Downloads License

Issue

See the issue than initiated this plugin (#2320)

Installation

yarn add vue-cli-proxy-plugin
# OR npm install vue-cli-proxy-plugin

Usage

// vue.config.js
module.exports = {
		pluginOptions: {
				proxy: {
						enabled: true,
						context: '',
						options: {
								// ...
						}
				}
		}
}

Options

See http-proxy-middleware for options object to pass to the plugin.

Object examples

  • First example of the docs:
// vue.config.js
module.exports = {
		pluginOptions: {
				proxy: {
						enabled: true,
						context: '/api',
						options: {
								target: 'http://www.example.org',
								changeOrigin: true
						}
				}
		}
}
  • v1.0.0 default:
// 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.

About

🔌 Provide all http-proxy-middleware options to vue-cli

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •