Skip to content
Snippets Groups Projects
vite.config.js 517 B
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import { stringToSlug } from "./src/utils";

// https://vitejs.dev/config/
export default () => {
  const env = loadEnv("dev", process.cwd());
  if (!env.VITE_TEAM_NAME) {
    throw new Error("VITE_TEAM_NAME environment variable is not defined");
  }
  return defineConfig({
    base: `/${stringToSlug(env.VITE_TEAM_NAME)}/`,
    plugins: [react()],
    build: {
      outDir: "dist",
    },
    publicDir: 'pubpub',
  });
  
};