38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "node:path";
|
|
|
|
const { QUALITEER_VITE_BACKEND_URL, QUALITEER_VITE_DEV_PORT } = process.env;
|
|
const backendUrl = QUALITEER_VITE_BACKEND_URL ?? "http://localhost:52000";
|
|
const vitePort = QUALITEER_VITE_DEV_PORT ?? 52025;
|
|
export default () => {
|
|
return defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port: vitePort,
|
|
proxy: {
|
|
"/api": backendUrl,
|
|
"/socket.io": backendUrl,
|
|
},
|
|
hmr: {
|
|
protocol: process.env.QUALITEER_VITE_DEV_PROTOCOL,
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "./build",
|
|
},
|
|
base: "/qualiteer/",
|
|
resolve: {
|
|
alias: {
|
|
"@qltr/util": path.resolve("./src/util/"),
|
|
"@qltr/queries": path.resolve("./src/util/queries"),
|
|
"@qltr/joins": path.resolve(`./src/util/Joins.jsx`),
|
|
"@qltr/jobs": path.resolve("./src/ctx/JobContext.jsx"),
|
|
"@qltr/store": path.resolve("./src/ctx/StoreContext.jsx"),
|
|
"@qltr/initiator": path.resolve("./lib/sockets/clients/Initiator.js"),
|
|
"@qltr/mocks": path.resolve("./lib/database/mocks/"),
|
|
},
|
|
},
|
|
});
|
|
};
|