48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import adapter from "@sveltejs/adapter-static";
|
|
import { sveltekit } from "@sveltejs/kit/vite";
|
|
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { defineConfig } from "vite";
|
|
|
|
const proxyTarget = process.env.API_PROXY_TARGET ?? "http://127.0.0.1:8080";
|
|
const allowedHosts = process.env.ALLOWED_HOSTS
|
|
? process.env.ALLOWED_HOSTS.split(",")
|
|
: undefined;
|
|
|
|
export default defineConfig({
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
loadPaths: ["src/lib/styles"],
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
tailwindcss(),
|
|
sveltekit({
|
|
adapter: adapter({
|
|
assets: "build",
|
|
fallback: "index.html",
|
|
pages: "build",
|
|
precompress: false,
|
|
strict: false,
|
|
}),
|
|
compilerOptions: {
|
|
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
|
|
runes: ({ filename }) =>
|
|
// biome-ignore lint/performance/useTopLevelRegex: svelte default
|
|
filename.split(/[/\\]/).includes("node_modules") ? undefined : true,
|
|
},
|
|
preprocess: [vitePreprocess()],
|
|
}),
|
|
],
|
|
server: {
|
|
allowedHosts,
|
|
proxy: {
|
|
"/api": { changeOrigin: true, target: proxyTarget },
|
|
"/f": { changeOrigin: true, target: proxyTarget },
|
|
"/mcp": { changeOrigin: true, target: proxyTarget },
|
|
},
|
|
},
|
|
});
|