forked from Gnathonic/mokuro-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
47 lines (44 loc) · 1.26 KB
/
Copy pathvite.config.ts
File metadata and controls
47 lines (44 loc) · 1.26 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 { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [sveltekit(), tailwindcss()],
worker: {
format: 'es'
},
server: {
host: true,
fs: {
// Allow serving package.json for version info import
allow: ['..']
}
},
optimizeDeps: {
exclude: ['clsx', 'tailwind-merge', 'apexcharts', '@floating-ui/dom']
},
build: {
sourcemap: true,
rollupOptions: {
onwarn(warning, warn) {
// Suppress sourcemap warnings from node_modules (e.g., Flowbite Svelte)
if (warning.code === 'SOURCEMAP_ERROR' && warning.message.includes('node_modules')) {
return;
}
// Suppress annotation warnings from node_modules
if (warning.code === 'INVALID_ANNOTATION' && warning.loc?.file?.includes('node_modules')) {
return;
}
warn(warning);
}
}
},
test: {
include: ['src/**/*.{test,spec}.{js,ts,svelte}'],
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test-setup.ts'],
// Resolve Svelte 5 for browser/client context in tests
server: { deps: { inline: ['svelte'] } }
},
resolve: { conditions: ['browser'] }
});