-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.hmr.ts
42 lines (40 loc) · 993 Bytes
/
vite.config.hmr.ts
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { defineConfig } from "vite";
import pluginReact from "@vitejs/plugin-react";
import pluginRenderer from "vite-plugin-electron-renderer";
import pluginSVGR from "vite-plugin-svgr";
import pluginTsconfigPaths from "vite-tsconfig-paths";
const EXTERNALS = [
"@tensorflow/tfjs-node",
"@tensorflow/tfjs-node-gpu",
"@vladmandic/face-api/dist/face-api.node-gpu.js",
"aws-sdk",
"crypto",
"fluent-ffmpeg",
"fs",
"mock-aws-s3",
"mongoose",
"nock",
"path",
"sharp",
];
export default defineConfig({
build: {
outDir: "build",
rollupOptions: { input: { app: "./index.hmr.html" } },
},
optimizeDeps: { exclude: EXTERNALS },
plugins: [
pluginReact(),
pluginRenderer({ nodeIntegration: true, resolve: () => EXTERNALS }),
pluginSVGR(),
pluginTsconfigPaths(),
],
resolve: {
extensions: [".tsx", ".ts", ".jsx", ".js", ".mjs", ".mts", ".json"],
},
server: {
open: "./index.hmr.html",
port: 3333,
strictPort: true,
},
});