-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
47 lines (46 loc) · 1.36 KB
/
Copy pathvite.config.ts
File metadata and controls
47 lines (46 loc) · 1.36 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
import { cloudflare } from "@cloudflare/vite-plugin";
import { cloudflareTest } from "@cloudflare/vitest-plugin";
import { defineConfig } from "vite-plus";
import { TEST_ADMIN_PASSWORD } from "./test/constants.ts";
export default defineConfig({
// The cloudflare() dev/build plugin and the cloudflareTest() plugin (which
// runs tests inside workerd) must not be active at the same time.
plugins: [
process.env.VITEST
? cloudflareTest({
main: "./src/index.ts",
miniflare: {
// Keep in sync with cloudflare.config.ts.
compatibilityDate: "2026-08-22",
versionMetadata: "VERSION",
kvNamespaces: ["LABELS_KV"],
ratelimits: {
MISS_LIMIT_IP: { namespace_id: "1001", simple: { limit: 600, period: 60 } },
MISS_LIMIT_DID: { namespace_id: "1002", simple: { limit: 120, period: 60 } },
},
bindings: { ADMIN_PASSWORD: TEST_ADMIN_PASSWORD, LABELERS: "[]" },
},
})
: cloudflare({ experimental: { newConfig: true } }),
],
test: {
exclude: ["test/integration/**", "node_modules/**"],
},
lint: {
ignorePatterns: [".cloudflare/**", ".wrangler/**", "dist/**", "worker-configuration.d.ts"],
options: {
typeAware: true,
typeCheck: true,
},
},
fmt: {
useTabs: true,
ignorePatterns: [
".cloudflare/**",
".wrangler/**",
"dist/**",
".claude/docs/**",
"worker-configuration.d.ts",
],
},
});