summaryrefslogtreecommitdiff
path: root/garden/vite.config.ts
blob: 0c1ca91f5b6317cbcdb467e30a30921c20d1b2c3 (plain)
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
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import devtools from "solid-devtools/vite";
import { copyFileSync } from "node:fs";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";

const __dirname = dirname(fileURLToPath(import.meta.url));

export default defineConfig({
  plugins: [
    devtools(),
    solidPlugin(),
    {
      name: "copy-not-found",
      closeBundle() {
        const dist = resolve(__dirname, "dist");
        copyFileSync(resolve(dist, "index.html"), resolve(dist, "not_found.html"));
      },
    },
  ],
  server: {
    port: 5173,
  },
  build: {
    target: "esnext",
  },
});