Files
famdone/frontend/vite.config.ts
T
2026-08-07 11:37:46 +01:00

44 lines
1.1 KiB
TypeScript

import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';
import { fileURLToPath, URL } from 'node:url';
import adapter from '@sveltejs/adapter-node';
import { sveltekit } from '@sveltejs/kit/vite';
export default defineConfig(() => {
return {
plugins: [
tailwindcss(),
sveltekit({
compilerOptions: {
runes: ({ filename }) =>
filename.split(/[/\\]/).includes('node_modules') ? undefined : true,
experimental: { async: true }
},
alias: {
'@shared': fileURLToPath(new URL('../shared', import.meta.url))
},
adapter: adapter(),
experimental: { remoteFunctions: true, handleRenderingErrors: true },
csrf: {
trustedOrigins: ['*']
}
})
],
server: {
fs: {
allow: ['.', './node_modules', '../node_modules']
},
// Dev only: allow access via any host/LAN IP without hardcoding it.
allowedHosts: true,
port: 2080,
proxy: {
'/api': {
// The vite dev server and Hono proxy run on the same host.
target: `http://127.0.0.1:3456`,
changeOrigin: true
}
}
}
};
});