Files
frigate/web/vite.config.ts
T

60 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-05-18 11:36:13 -05:00
import path, { resolve } from "path";
2024-02-28 15:23:56 -07:00
import { defineConfig } from "vite";
2026-09-14 08:16:31 -05:00
import react from "@vitejs/plugin-react";
2024-02-28 15:23:56 -07:00
import monacoEditorPlugin from "vite-plugin-monaco-editor";
2022-03-05 22:16:31 -06:00
2026-02-27 09:55:36 -06:00
const proxyHost = process.env.PROXY_HOST || "localhost:5000";
2024-05-18 11:36:13 -05:00
2022-03-05 22:16:31 -06:00
// https://vitejs.dev/config/
export default defineConfig({
2023-10-06 22:20:30 -05:00
server: {
proxy: {
2024-02-28 15:23:56 -07:00
"/api": {
2024-05-18 11:36:13 -05:00
target: `http://${proxyHost}`,
2023-12-16 16:20:59 +00:00
ws: true,
},
2024-02-28 15:23:56 -07:00
"/vod": {
2024-05-18 11:36:13 -05:00
target: `http://${proxyHost}`,
},
2024-02-28 15:23:56 -07:00
"/clips": {
2024-05-18 11:36:13 -05:00
target: `http://${proxyHost}`,
2023-12-16 16:20:59 +00:00
},
2024-02-28 15:23:56 -07:00
"/exports": {
2024-05-18 11:36:13 -05:00
target: `http://${proxyHost}`,
2023-12-07 19:08:35 -06:00
},
2024-02-28 15:23:56 -07:00
"/ws": {
2024-05-18 11:36:13 -05:00
target: `ws://${proxyHost}`,
2023-12-07 19:08:35 -06:00
ws: true,
},
2024-02-28 15:23:56 -07:00
"/live": {
2024-05-18 11:36:13 -05:00
target: `ws://${proxyHost}`,
2023-12-07 19:08:35 -06:00
changeOrigin: true,
ws: true,
},
2024-02-28 15:23:56 -07:00
},
2023-10-06 22:20:30 -05:00
},
2024-05-18 11:36:13 -05:00
build: {
2026-09-14 08:16:31 -05:00
rolldownOptions: {
2024-05-18 11:36:13 -05:00
input: {
2026-09-14 08:16:31 -05:00
main: resolve(import.meta.dirname, "index.html"),
login: resolve(import.meta.dirname, "login.html"),
},
output: {
keepNames: true,
2024-05-18 11:36:13 -05:00
},
},
},
2022-12-30 09:48:22 -06:00
plugins: [
2023-12-16 16:20:59 +00:00
react(),
2022-12-30 09:48:22 -06:00
monacoEditorPlugin.default({
2024-02-28 15:23:56 -07:00
customWorkers: [{ label: "yaml", entry: "monaco-yaml/yaml.worker" }],
languageWorkers: ["editorWorkerService"], // we don't use any of the default languages
2022-12-30 09:48:22 -06:00
}),
],
2023-12-16 16:20:59 +00:00
resolve: {
alias: {
2026-09-14 08:16:31 -05:00
"@": path.resolve(import.meta.dirname, "./src"),
2023-12-16 16:20:59 +00:00
},
},
2024-02-28 15:23:56 -07:00
});