-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathvite.config.js
More file actions
54 lines (52 loc) · 1.46 KB
/
vite.config.js
File metadata and controls
54 lines (52 loc) · 1.46 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
import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
import Icons from 'unplugin-icons/vite';
import { defineConfig } from 'vite';
import devtoolsJson from 'vite-plugin-devtools-json';
/**
* HMR creates state inconsistencies, so we always reload the page.
* @type {import('vite').PluginOption} PluginOption
*/
const alwaysFullReload = {
name: 'always-full-reload',
handleHotUpdate({ server }) {
server.ws.send({ type: 'full-reload' });
return [];
}
};
export default defineConfig({
plugins: [
tailwindcss(),
sveltekit(),
Icons({
compiler: 'svelte',
customCollections: {
custom: FileSystemIconLoader('./static/icons')
}
}),
alwaysFullReload,
devtoolsJson()
],
envPrefix: 'MERMAID_',
server: { port: 3000, host: true },
preview: { port: 3000, host: true },
test: {
environment: 'jsdom',
// in-source testing
includeSource: ['src/**/*.{js,ts,svelte}'],
// Ignore E2E tests
exclude: [
'tests/**/*',
'**/node_modules/**',
'**/dist/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*'
],
setupFiles: ['./src/tests/setup.ts'],
coverage: {
exclude: ['src/mocks', '.svelte-kit', 'src/**/*.test.ts'],
reporter: ['text', 'json', 'html', 'lcov']
}
}
});