etherpad-lite/admin/vite.config.ts

35 lines
852 B
TypeScript
Raw Normal View History

2024-03-09 09:45:33 +01:00
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import svgr from 'vite-plugin-svgr'
2024-03-09 14:04:00 +01:00
import {viteStaticCopy} from "vite-plugin-static-copy";
2024-03-09 09:45:33 +01:00
// https://vitejs.dev/config/
export default defineConfig({
2024-03-09 14:04:00 +01:00
plugins: [react(), svgr(), viteStaticCopy({
targets: [
{
src: '../src/locales',
dest: ''
}
]
})],
base: '/admin',
2024-03-09 22:32:04 +01:00
build:{
outDir: '../src/templates/admin'
},
2024-03-09 09:45:33 +01:00
server:{
proxy: {
2024-03-09 22:32:04 +01:00
'/socket.io/*': {
2024-03-09 09:45:33 +01:00
target: 'http://localhost:9001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
2024-03-09 22:32:04 +01:00
'/admin-auth/': {
2024-03-09 09:45:33 +01:00
target: 'http://localhost:9001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/admin-prox/, '/admin/')
}
}
}
})