better backend comms

This commit is contained in:
johba 2025-09-24 09:41:28 +02:00
parent d0e8623cf9
commit 02a057622c
17 changed files with 1054 additions and 134 deletions

View file

@ -5,16 +5,35 @@ import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
export default defineConfig(() => {
const localRpcProxyTarget = process.env.VITE_LOCAL_RPC_PROXY_TARGET
return {
// base: "/HarbergPublic/",
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'kraiken-lib': fileURLToPath(new URL('../kraiken-lib/src', import.meta.url)),
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,
},
}
})