/ concept-collection / fastandaccurate
Sign in
concept-collection / fastandaccurate
fastandaccurate / vite.config.ts
26 lines · 666 BBlameHistoryRaw
1import { defineConfig } from "vite";
2import react from "@vitejs/plugin-react";
3import { readFileSync } from "fs";
4import { fileURLToPath } from "url";
5import { dirname, join } from "path";
7const root = dirname(fileURLToPath(import.meta.url));
8const numblVersion = (
9 JSON.parse(
10 readFileSync(join(root, "node_modules", "numbl", "package.json"), "utf-8")
11 ) as { version: string }
12).version;
14export default defineConfig({
15 base: "./",
16 plugins: [react()],
17 define: {
18 __NUMBL_VERSION__: JSON.stringify(numblVersion),
19 __BUILD_ID__: JSON.stringify(
20 process.env.GITHUB_SHA?.slice(0, 7) ?? "dev"
21 ),
22 },
23 worker: {
24 format: "es",
25 },
26});
moveopenescclose