40 lines
960 B
TypeScript
40 lines
960 B
TypeScript
import tailwindcss from '@tailwindcss/vite';
|
|
import { defineConfig } from 'vite';
|
|
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 }
|
|
},
|
|
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
|
|
}
|
|
}
|
|
}
|
|
};
|
|
});
|