37 lines
939 B
TypeScript
37 lines
939 B
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 as true,
|
|
port: 2080
|
|
}
|
|
};
|
|
});
|