-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.mts
More file actions
61 lines (58 loc) · 1.39 KB
/
vite.config.mts
File metadata and controls
61 lines (58 loc) · 1.39 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
import { defineConfig, mergeConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig as defineVitestConfig } from "vitest/config";
import { nodePolyfills } from "vite-plugin-node-polyfills";
const viteConfig = defineConfig({
define: {
global: "globalThis",
globalThis: "globalThis",
},
worker: {
format: "es",
},
plugins: [
tsconfigPaths(),
nodePolyfills({
protocolImports: true,
globals: { Buffer: false, global: false, process: false },
}),
],
optimizeDeps: {
exclude: ["@xmtp/wasm-bindings", "@xmtp/browser-sdk"],
include: ["buffer", "protobufjs/minimal"],
},
resolve: {
alias: {
buffer: "buffer/",
},
},
});
const vitestConfig = defineVitestConfig({
optimizeDeps: {
exclude: ["@xmtp/wasm-bindings", "@xmtp/browser-sdk"],
include: ["buffer", "protobufjs/minimal"],
},
resolve: {
alias: {
buffer: "buffer/",
},
},
test: {
// Specifically include browser and common folder tests
include: ["src/browser/**/*.test.{ts,js}", "src/common/**/*.test.{ts,js}"],
browser: {
enabled: true,
provider: "playwright",
instances: [{ browser: "chromium" }],
headless: true,
},
testTimeout: 1200000,
retry: 3,
},
server: {
fs: {
allow: [process.cwd()],
},
},
});
export default mergeConfig(viteConfig, vitestConfig);