2025-11-20 19:09:43 +00:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
|
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
2025-12-12 12:18:17 +00:00
|
|
|
import pkg from "./package.json";
|
|
|
|
|
import { execSync } from "child_process";
|
|
|
|
|
|
|
|
|
|
const gitCommitHash = (() => {
|
|
|
|
|
try {
|
|
|
|
|
return execSync("git rev-parse --short HEAD").toString().trim();
|
|
|
|
|
} catch {
|
|
|
|
|
return "unknown";
|
|
|
|
|
}
|
|
|
|
|
})();
|
|
|
|
|
|
|
|
|
|
const gitCommitTimeStamp = (() => {
|
|
|
|
|
try {
|
|
|
|
|
return execSync("git log -1 --format=%cd --date=iso").toString().trim();
|
|
|
|
|
} catch {
|
|
|
|
|
return "unknown";
|
|
|
|
|
}
|
|
|
|
|
})();
|
2025-11-20 19:09:43 +00:00
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
|
export default defineConfig({
|
2025-12-11 10:52:13 +00:00
|
|
|
base: "/bayiq",
|
2025-12-12 12:18:17 +00:00
|
|
|
define: {
|
|
|
|
|
__APP_NAME__: JSON.stringify(pkg.name),
|
|
|
|
|
__APP_VERSION__: JSON.stringify(pkg.version),
|
|
|
|
|
__GIT_COMMIT__: JSON.stringify(gitCommitHash),
|
|
|
|
|
__GIT_TIMESTAMP__: JSON.stringify(gitCommitTimeStamp),
|
|
|
|
|
},
|
2025-11-20 19:09:43 +00:00
|
|
|
plugins: [
|
|
|
|
|
tanstackRouter({
|
|
|
|
|
target: "react",
|
2025-12-12 08:32:06 +00:00
|
|
|
autoCodeSplitting: false,
|
2025-11-20 19:09:43 +00:00
|
|
|
}),
|
|
|
|
|
react(),
|
|
|
|
|
tailwindcss(),
|
|
|
|
|
],
|
2025-12-02 13:45:44 +00:00
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
"/api": {
|
|
|
|
|
target: "http://100.115.125.56",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-12-12 08:32:06 +00:00
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks: undefined,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-11-20 19:09:43 +00:00
|
|
|
});
|