forked from naufaldi/mac-fan-ctrl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (43 loc) · 1.2 KB
/
Copy pathvite.config.ts
File metadata and controls
45 lines (43 loc) · 1.2 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
/// <reference types="vitest/config" />
import path from "node:path";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import tailwindcss from "@tailwindcss/vite";
import type { PluginOption } from "vite";
import { defineConfig } from "vite";
const e2eMock = process.env.VITE_E2E_MOCK === "true";
export default defineConfig({
plugins: [
tailwindcss(),
svelte() as unknown as PluginOption,
],
server: {
port: 1420,
strictPort: true,
hmr: {
overlay: true,
},
},
test: {
environment: "happy-dom",
setupFiles: ["./vitest-setup.ts"],
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
},
resolve: {
conditions: ["browser"],
alias: {
...(e2eMock
? {
"@tauri-apps/api/core": path.resolve(__dirname, "src/e2e/tauriMockCore.ts"),
"@tauri-apps/api/event": path.resolve(__dirname, "src/e2e/tauriMockCore.ts"),
"@tauri-apps/api/window": path.resolve(__dirname, "src/e2e/mockWindow.ts"),
}
: {}),
"@": path.resolve(__dirname, "src"),
$lib: path.resolve(__dirname, "src/lib"),
$components: path.resolve(__dirname, "src/components"),
$stores: path.resolve(__dirname, "src/stores"),
$types: path.resolve(__dirname, "src/types"),
},
},
base: "./",
});