Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
39 lines (38 loc) · 1.5 KB
/
Copy pathvite.config.ts
File metadata and controls
39 lines (38 loc) · 1.5 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
38
39
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { resolve } from "node:path";
export default defineConfig(({ command }) => {
const appDisplayName = command === "serve" ? "Aiden Agent Dev" : "Aiden Agent";
return {
plugins: [react(), tailwindcss()],
base: "./",
assetsInclude: ["**/*.wasm"],
define: { __APP_DISPLAY_NAME__: JSON.stringify(appDisplayName) },
resolve: {
alias: {
"@renderer": resolve(import.meta.dirname, "renderer"),
"@main": resolve(import.meta.dirname, "main"),
},
},
build: {
outDir: "build/renderer",
emptyOutDir: true,
// Hidden maps: emitted for release symbolication (uploaded as a CI
// artifact) but never referenced from the shipped bundles, and the
// packager excludes every *.map file from app.asar.
sourcemap: "hidden",
// The write-pty trampoline is 112 bytes. Vite's default 4kb inline
// limit would emit it as a data: URL; Chromium then fetches that URL
// under CSP connect-src 'self', which fails. Keep wasm as real files.
assetsInlineLimit: (filePath) => (filePath.endsWith(".wasm") ? false : undefined),
rollupOptions: {
input: {
"main-window": resolve(import.meta.dirname, "main-window.html"),
pill: resolve(import.meta.dirname, "pill.html"),
"visual-snapshot": resolve(import.meta.dirname, "visual-snapshot.html"),
},
},
},
};
});