-
Notifications
You must be signed in to change notification settings - Fork 327
Expand file tree
/
Copy pathvite.config.ts
More file actions
68 lines (67 loc) · 1.94 KB
/
vite.config.ts
File metadata and controls
68 lines (67 loc) · 1.94 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
62
63
64
65
66
67
68
/// <reference types="vitest" />
import { sveltekit } from "@sveltejs/kit/vite";
import examples from "mdsvexamples/vite";
import path from "path";
import pkg from "./package.json" with { type: "json" };
import devtoolsJson from "vite-plugin-devtools-json";
import tiptapPackage from "./node_modules/@tiptap/core/package.json";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vitest/config";
import textEditorPackage from "./node_modules/@flowbite-svelte-plugins/texteditor/package.json" with { type: "json" };
import { playwright } from "@vitest/browser-playwright";
export default defineConfig({
plugins: [sveltekit(), tailwindcss(), devtoolsJson(), examples],
build: {
chunkSizeWarningLimit: 1600
},
server: {
port: 8080,
strictPort: false
},
optimizeDeps: {
exclude: ["flowbite-svelte"]
},
resolve: {
alias: {
"flowbite-svelte": path.resolve(process.cwd(), "./src/lib/index.ts")
}
},
test: {
projects: [
{
extends: "./vite.config.ts",
test: {
name: "client",
browser: {
enabled: true,
provider: playwright(),
instances: [
{
browser: "chromium",
headless: true
}
// { browser: 'firefox' },
// { browser: 'webkit' }
]
},
include: ["src/tests/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
setupFiles: ["./vitest-setup-client.ts"]
}
},
{
test: {
name: "server",
environment: "node",
include: ["src/**/*.{test,spec}.{js,ts}"],
exclude: ["src/tests/**/*.{test,spec}.?(c|m)[jt]s?(x)"]
}
}
]
},
define: {
__NAME__: JSON.stringify(pkg.name),
__VERSION__: JSON.stringify(pkg.version),
__TIPTAP__: JSON.stringify(tiptapPackage.version),
__TEXTEDITOR__: JSON.stringify(textEditorPackage.version)
}
});