43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { compression } from "vite-plugin-compression2";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
svelte(),
|
|
tailwindcss(),
|
|
compression({
|
|
algorithm: "gzip",
|
|
exclude: [/\.(br)$/, /\.(gz)$/],
|
|
threshold: 1024,
|
|
}),
|
|
compression({
|
|
algorithm: "brotliCompress",
|
|
exclude: [/\.(br)$/, /\.(gz)$/],
|
|
threshold: 1024,
|
|
filename: "[path][base].br",
|
|
}),
|
|
],
|
|
base: "/ui/",
|
|
build: {
|
|
outDir: "../proxy/ui_dist",
|
|
assetsDir: "assets",
|
|
},
|
|
server: {
|
|
// yes very insecure but who's running this thing
|
|
// on the public internet for dev?! haha.
|
|
host: "0.0.0.0",
|
|
allowedHosts: true,
|
|
proxy: {
|
|
"/api": "http://localhost:8080", // Proxy API calls to Go backend during development
|
|
"/logs": "http://localhost:8080",
|
|
"/upstream": "http://localhost:8080",
|
|
"/unload": "http://localhost:8080",
|
|
"/v1": "http://localhost:8080",
|
|
"/sdapi": "http://localhost:8080",
|
|
},
|
|
},
|
|
});
|