Recipie/astro.config.mjs
2025-08-12 21:25:41 +12:00

34 lines
864 B
JavaScript

// @ts-check
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import tailwindcss from '@tailwindcss/vite';
import { loadEnv } from "vite";
const { PUBLIC_PB_URL } = loadEnv(process.env.NODE_ENV, process.cwd(), "");
// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: node({
mode: 'standalone'
}),
vite: {
plugins: [tailwindcss()],
server: {
proxy: {
// The idea is to proxy the Pocketbase connection to the current domain so the user doesn't have to open two ports
// Currently works in dev (npm run dev -- --host) with the correct PUBLIC_URL var set but not through docker
'/api': {
target: PUBLIC_PB_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '/api'),
},
}
}
}
});