-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
45 lines (44 loc) · 1.17 KB
/
vite.config.ts
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
import graphql from '@rollup/plugin-graphql'
import { sveltekit } from '@sveltejs/kit/vite'
import houdini from 'houdini/vite'
// import codegen from 'vite-plugin-graphql-codegen'
import watchAndRun from 'vite-plugin-watch-and-run'
import svelteSVG from 'vite-plugin-svelte-svg'
import { defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [
graphql(),
svelteSVG({
requireSuffix: false,
svgoConfig: {},
}),
houdini(),
sveltekit(),
// graphql-codegen doesn't work properly for schema files unfortunately
// codegen({
// configFilePathOverride: './codegen.cjs',
// matchOnSchemas: true,
// }),
watchAndRun([
{
name: 'graphql-codegen',
watchKind: ['add', 'change', 'unlink'],
watch: 'src/lib/client/graphql/**/*.graphql',
run: 'npm run codegen',
delay: 250,
},
]),
watchAndRun([
{
name: 'graphql-schema-codegen',
watchKind: ['change'],
watch: 'src/lib/server/graphql/schema.graphql',
run: 'npm run codegen',
delay: 250,
},
]),
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}'],
},
})