Skip to content
vite.config.js 477 B
Newer Older
Grant's avatar
Grant committed
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import * as child from "child_process";

const commitHash = child
  .execSync("git rev-parse --short HEAD")
  .toString()
  .trim();
Grant's avatar
Grant committed

export default defineConfig({
  root: "src",
  envDir: "..",
  build: {
Grant's avatar
Grant committed
    outDir: "../dist",
Grant's avatar
Grant committed
    emptyOutDir: true,
Grant's avatar
Grant committed
  },
  plugins: [
    react({
      include: "**/*.{jsx,tsx}",
    }),
  ],
  define: {
    __COMMIT_HASH__: JSON.stringify(commitHash),
  },
Grant's avatar
Grant committed
});