Skip to content

Instantly share code, notes, and snippets.

@brightsheden
Created February 20, 2024 14:45
Show Gist options
  • Save brightsheden/1ea5ec310b54e7814cc7dd9c27431ac8 to your computer and use it in GitHub Desktop.
Save brightsheden/1ea5ec310b54e7814cc7dd9c27431ac8 to your computer and use it in GitHub Desktop.
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
//base: "/static/",
build: {
manifest: true,
outDir: 'dist',
assetsDir: 'static',
},
plugins: [react(),
],
server:{
proxy: {
'/api': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
secure: false,
ws: true,
//rewrite: (path) => path.replace(/^\/api/, ''),
// agent:new http.Agent()
},
'/images':{
target: 'http://127.0.0.1:8000',
changeOrigin: true,
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment