You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
553 B

import {defineConfig, loadEnv} from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default ({mode}) => {
//@ts-ignore
process.env = {...process.env, ...loadEnv(mode, process.cwd())}
return defineConfig({
plugins: [react()],
build: {
//@ts-ignore
outDir: process.env.VITE_MODE === "webapp" ? "./dist-webapp" : "./dist-chrome",
},
server: {
proxy: {
"/api": {
target: 'http://localhost:9301',
changeOrigin: true,
},
}
},
});
}