Skip to content

deraw/vue-cli-plugin-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

VueDot

CNAM โ€“ Vue CLI plugin proxy

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

As Easy as 1, 2, 3

Install

yarn add @cnamts/vue-cli-plugin-proxy # OR npm install @cnamts/vue-cli-plugin-proxy

Use

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

You're done! ๐ŸŽ‰

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: {
			context: '/api',
            options: {
                target: 'http://www.example.org',
                changeOrigin: true
            }
        }
    }
}
  • v1.0.0 default:
// vue.config.js
module.exports = {
    pluginOptions: {
        proxy: {
			context: ['/**', '!/dist/**'],
            options: {
                target: 'http://127.0.0.1:8000',
            }
        }
    }
}

License

Vue CLI plugin proxy is licensed under a 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

  •  
  •  
  •  
  •