2024-02-13 22:39:56 -08:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import react from "@vitejs/plugin-react";
|
2024-05-26 13:23:54 -07:00
|
|
|
import * as child from "child_process";
|
|
|
|
|
|
|
|
const commitHash = child
|
|
|
|
.execSync("git rev-parse --short HEAD")
|
|
|
|
.toString()
|
|
|
|
.trim();
|
2024-02-13 22:39:56 -08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
root: "src",
|
|
|
|
envDir: "..",
|
|
|
|
build: {
|
2024-03-02 18:18:25 -08:00
|
|
|
outDir: "../dist",
|
2024-03-11 19:59:47 -07:00
|
|
|
emptyOutDir: true,
|
2024-07-12 11:36:42 -07:00
|
|
|
sourcemap: true,
|
2024-02-13 22:39:56 -08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
react({
|
|
|
|
include: "**/*.{jsx,tsx}",
|
|
|
|
}),
|
|
|
|
],
|
2024-05-26 13:23:54 -07:00
|
|
|
define: {
|
|
|
|
__COMMIT_HASH__: JSON.stringify(commitHash),
|
|
|
|
},
|
2024-02-13 22:39:56 -08:00
|
|
|
});
|