view web/vite.config.ts @ 17:0d72635fc501

reloadIndexIfChanged
author drewp@bigasterisk.com
date Fri, 19 Jul 2024 00:59:45 -0700
parents a4659594f2e5
children
line wrap: on
line source

import { defineConfig } from "vite";

export default defineConfig({
  base: "/sco/",
  server: {
    host: "0.0.0.0",
    strictPort: true,
    port: 8002,
    hmr: { path: "vite-ws" },
    fs: {
      allow: [
        // these are relative to config.root which is ./src/
        ".",
        "../node_modules",
      ],
    },
    proxy: {
      "/sco/query": {
        target: "http://127.0.0.1:8001/",
      },
    },
  },
  root: "src",
  build: {
    assetsDir: "src",
    target: "esnext",
    lib: {
      entry: "src/index.ts",
      formats: ["es"],
    },
  },
  define: {
    global: {},
  },
});