-
Notifications
You must be signed in to change notification settings - Fork 45
/
vite.config.js
56 lines (55 loc) · 1.33 KB
/
vite.config.js
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
/// <reference types="vitest" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import resolve from "@rollup/plugin-node-resolve";
import { visualizer } from "rollup-plugin-visualizer";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
resolve: {
preferBuiltins: false,
browser: true,
alias: { "./runtimeConfig": "./runtimeConfig.browser" },
},
test: {
testTimeout: 60_000,
hookTimeout: 60_000,
exclude: [
"**/tests/integration/**",
"**/node_modules/**",
"**/dist/**",
"**/cypress/**",
"**/.{idea,git,cache,output,temp}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
],
// environment: 'jsdom'
},
build: {
rollupOptions: {
external: [/^node:.*/],
},
},
plugins: [
react({
fastRefresh: process.env.NODE_ENV !== "test",
}),
{
...resolve({
preferBuiltins: false,
browser: true,
alias: { "./runtimeConfig": "./runtimeConfig.browser" },
}),
enforce: "pre",
apply: "build",
},
visualizer(),
VitePWA({
registerType: "autoUpdate",
devOptions: {
enabled: true,
},
}),
],
server: {
hmr: { clientPort: process.env.CODESPACES ? 443 : undefined },
},
});