harb/web-app/vite.config.ts

40 lines
1 KiB
TypeScript
Raw Normal View History

2025-07-24 16:08:17 +02:00
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
2025-09-24 09:41:28 +02:00
export default defineConfig(() => {
const localRpcProxyTarget = process.env.VITE_LOCAL_RPC_PROXY_TARGET
return {
2025-09-23 14:18:04 +02:00
// base: "/HarbergPublic/",
2025-09-24 09:41:28 +02:00
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'kraiken-lib': fileURLToPath(new URL('../kraiken-lib/src', import.meta.url)),
},
},
server: {
proxy: localRpcProxyTarget
? {
'/rpc/anvil': {
target: localRpcProxyTarget,
changeOrigin: true,
secure: false,
rewrite: (path) => {
const rewritten = path.replace(/^\/rpc\/anvil/, '')
return rewritten.length === 0 ? '/' : rewritten
},
},
}
: undefined,
2025-07-24 16:08:17 +02:00
},
2025-09-24 09:41:28 +02:00
}
2025-07-24 16:08:17 +02:00
})