A Vite plugin that provides webpack-dev-server-style proxy functionality for Vite's dev server, wrapping http-proxy-middleware. Current stable version is 0.5.0. Release cadence is low. Key differentiator: offers a familiar API for webpack users migrating to Vite, with full http-proxy-middleware options support. Note: Vite 2+ includes built-in proxy support via server.proxy, which is the recommended approach; this plugin is primarily for those wanting an explicit plugin or custom HTTP proxy middleware behavior.
npm install vite-plugin-proxyVerified import paths — ran on the pinned version, not inferred.
Shows a minimal Vite config using vite-plugin-proxy to proxy /api to a remote target with cache headers.
Use Vite's built-in proxy: export default defineConfig({ server: { proxy: { '/api': { target: 'http://example.com' } } } });Refer to http-proxy-middleware documentation; test thoroughly with your Vite version.
Use environment checks or conditionally apply the plugin only in dev mode: plugins: [process.env.NODE_ENV === 'development' && proxyPlugin(...)].filter(Boolean)
Install the package: npm install vite-plugin-proxy --save-dev
Use default import: import proxyPlugin from 'vite-plugin-proxy'