qualiteer/vite.config.js

41 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-07-06 21:24:54 +00:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
2022-08-12 13:08:00 +00:00
import path from "node:path";
2022-07-06 21:24:54 +00:00
2022-10-08 17:47:46 +00:00
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;
2022-07-06 21:24:54 +00:00
export default () => {
2022-07-12 22:07:44 +00:00
return defineConfig({
plugins: [react()],
server: {
host: "0.0.0.0",
2022-10-08 17:47:46 +00:00
port: vitePort,
2022-08-05 13:03:48 +00:00
proxy: {
2022-10-08 17:47:46 +00:00
"/api": backendUrl,
"/socket.io": backendUrl,
},
hmr: {
protocol: process.env.QUALITEER_VITE_DEV_PROTOCOL,
2022-08-12 13:08:00 +00:00
},
2022-07-12 22:07:44 +00:00
},
2022-07-12 23:28:47 +00:00
build: {
outDir: "./build",
},
base: "/qualiteer/",
2022-08-12 13:08:00 +00:00
resolve: {
alias: {
"@qltr/util": path.resolve("./src/util/"),
"@qltr/queries": path.resolve("./src/util/queries"),
2022-10-15 11:47:47 +00:00
"@qltr/jobcore": path.resolve("./src/job-core/JobCore.jsx"),
"@qltr/jobctx": path.resolve("./src/ctx/JobContext.jsx"),
2022-08-12 13:08:00 +00:00
"@qltr/store": path.resolve("./src/ctx/StoreContext.jsx"),
2022-10-15 11:47:47 +00:00
"@qltr/initiator": path.resolve(
"./lib/common/sockets/clients/Initiator.js"
),
"@qltr/mocks": path.resolve("./lib/server/database/mocks/"),
2022-08-12 13:08:00 +00:00
},
},
2022-07-12 22:07:44 +00:00
});
};