-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.ts
52 lines (49 loc) · 1.15 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
/// <reference types="vitest" />
import { defineConfig } from "vite";
import path from "path";
import react from "@vitejs/plugin-react";
import aliases from "./aliases.paths.json";
import viteTsconfigPaths from "vite-tsconfig-paths";
import svgrPlugin from "vite-plugin-svgr";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import dns from "dns";
const resolvedAliases = Object.fromEntries(
Object.entries(aliases).map(([key, value]) => [key, path.resolve(__dirname, value)])
);
dns.setDefaultResultOrder("verbatim");
export default defineConfig({
test: {
globals: true,
environment: "jsdom",
setupFiles: "./setupTests.ts",
coverage: {
reporter: ["text", "html"],
exclude: ["node_modules/", "setupTests.ts"],
},
},
build: {
outDir: "build",
commonjsOptions: {
transformMixedEsModules: true,
},
},
resolve: {
alias: resolvedAliases,
},
server: {
open: true,
host: "localhost",
},
plugins: [
react(),
viteTsconfigPaths(),
svgrPlugin(),
nodePolyfills({
globals: {
Buffer: true,
global: true,
process: true,
},
}),
],
});