@deraw/vue-cli-plugin-proxy

Provide all http-proxy-middleware options to vue-cli
5,304 11
Install
npm install @deraw/vue-cli-plugin-proxy
Latest Version:2.2.7
License:MIT
Last Updated:Feb 12, 2022
Links: GitHub  ·  npm
Maintainer: deraw

Vue CLI proxy plugin

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

NPM Version NPM Downloads License The issue

Issue

See the issue than initiated this plugin (#2320)

Installation

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

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.

Related Packages

vue-cli-plugin-moment

moment.js plugin for vue-cli

28,960 15
@urbanhire.com/vuesable

Vuesable is urbanhire vue component.

877
vue-cli-plugin-nid

这是宁皓网内部项目使用的一个 Vue CLI 插件,在使用了 TypeScript 的 Vue 项目里,可...

778 0

Version History

Version Released License
2.2.7 MIT
2.2.6 MIT
2.2.5 MIT
2.2.4 MIT