-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
57 lines (52 loc) · 1.31 KB
/
vite.config.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* epic-stack: https://github.com/epicweb-dev/epic-stack/blob/main/vite.config.ts
*/
import { reactRouter } from "@react-router/dev/vite";
import preserveDirectives from "rollup-preserve-directives";
import { defineConfig } from "vite";
// import { flatRoutes } from "remix-flat-routes";
import tsconfigPaths from "vite-tsconfig-paths";
const MODE = process.env.NODE_ENV;
// declare module "@remix-run/node" {
// // or cloudflare, deno, etc.
// interface Future {
// v3_singleFetch: true;
// }
// }
export default defineConfig({
esbuild: {
target: "es2022",
},
build: {
target: "es2022",
cssMinify: MODE === "production",
rollupOptions: {
external: [/node:.*/, "fsevents"],
output: {
format: "es",
},
},
sourcemap: true, // not sure if we really should use it
},
optimizeDeps: {
esbuildOptions: {
target: "es2022",
},
},
plugins: [
preserveDirectives(),
tsconfigPaths(),
process.env.NODE_ENV === "test" ? null : reactRouter(),
],
test: {
globals: true,
environment: "happy-dom",
setupFiles: ["./test/setup-test-env.ts"],
include: ["./app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
exclude: [
".*\\/node_modules\\/.*",
".*\\/build\\/.*",
".*\\/postgres-data\\/.*",
],
},
});