-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (34 loc) · 1.01 KB
/
Copy pathvite.config.ts
File metadata and controls
37 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import fs from "node:fs";
import path from "node:path";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig, loadEnv } from "vite";
const pkg = JSON.parse(fs.readFileSync(new URL("./package.json", import.meta.url), "utf8")) as {
version: string;
};
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
plugins: [react(), tailwindcss()],
clearScreen: false,
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
__POSTHOG_KEY__: JSON.stringify(env.VITE_POSTHOG_KEY ?? ""),
__POSTHOG_HOST__: JSON.stringify(env.VITE_POSTHOG_HOST ?? "https://us.i.posthog.com"),
__INSTALL_CHANNEL__: JSON.stringify(env.VITE_INSTALL_CHANNEL ?? ""),
},
server: {
host: "127.0.0.1",
port: 1420,
strictPort: true,
watch: {
ignored: ["**/src-tauri/**"],
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
};
});