-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvite.config.ts
More file actions
109 lines (108 loc) · 2.49 KB
/
vite.config.ts
File metadata and controls
109 lines (108 loc) · 2.49 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { defineConfig } from "vite";
import { configDefaults } from "vitest/config";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import tailwindcss from "@tailwindcss/vite";
import { nitro } from "nitro/vite";
import { visualizer } from "rollup-plugin-visualizer";
export default defineConfig({
server: {
host: "0.0.0.0",
port: 3000,
},
build: {
rollupOptions: {
external: ["@google-cloud/translate"],
},
},
environments: {
client: {
build: {
rollupOptions: {
plugins: [
visualizer({
filename: ".output/stats/client.html",
gzipSize: true,
}),
],
},
},
},
ssr: {
build: {
rollupOptions: {
plugins: [
visualizer({
filename: ".output/stats/ssr.html",
gzipSize: true,
}),
],
},
},
},
nitro: {
build: {
rollupOptions: {
plugins: [
visualizer({
filename: ".output/stats/server.html",
gzipSize: true,
}),
],
},
},
},
},
plugins: [
tailwindcss(),
tsconfigPaths({ projectDiscovery: "lazy" }),
tanstackStart({
router: {
semicolons: true,
quoteStyle: "double",
},
}),
nitro({
compressPublicAssets: true,
}),
viteReact(),
],
test: {
projects: [
{
extends: true,
test: {
name: "unit (server)",
environment: "node",
include: ["**/*.unit.ts"],
exclude: [...configDefaults.exclude, "**/*.client.unit.ts"],
setupFiles: ["./tests/vitest/testSetup.ts"],
mockReset: true,
},
},
{
extends: true,
test: {
name: "unit (client)",
environment: "jsdom",
include: ["**/*.client.unit.{ts,tsx}"],
setupFiles: ["./tests/vitest/testSetup.ts"],
globalSetup: ["./tests/vitest/tzSetup.ts"],
mockReset: true,
},
},
{
extends: true,
test: {
name: "integration (server)",
environment: "node",
include: ["**/*.test.ts"],
setupFiles: ["./tests/vitest/testSetup.ts"],
globalSetup: ["./tests/vitest/dbSetup.ts"],
mockReset: true,
},
},
],
},
});