barebones docker | pocketbase | hono | svelte
This commit is contained in:
+30
-21
@@ -1,29 +1,38 @@
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import adapter from '@sveltejs/adapter-node';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import { PROXY_PORT } from '../config';
|
||||
import { SERVER_IP, FRONTEND_PORT, PROXY_PORT } from '../config.ts';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
sveltekit({
|
||||
compilerOptions: {
|
||||
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
|
||||
runes: ({ filename }) =>
|
||||
filename.split(/[/\\]/).includes('node_modules') ? undefined : true,
|
||||
experimental: { async: true }
|
||||
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']
|
||||
},
|
||||
adapter: adapter(),
|
||||
experimental: { remoteFunctions: true, handleRenderingErrors: true }
|
||||
})
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: `http://localhost:${PROXY_PORT}`,
|
||||
changeOrigin: true
|
||||
allowedHosts: [SERVER_IP],
|
||||
port: FRONTEND_PORT,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: `http://${SERVER_IP}:${PROXY_PORT}`,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user