-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
34 lines (33 loc) · 960 Bytes
/
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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import fs from 'node:fs';
import path from 'node:path';
import { CursorTheme, Variant } from './src/lib/models/cursor-theme';
import svg from '@poppanator/sveltekit-svg';
import { AnimationList } from './src/lib/models/animation/animation';
export default defineConfig({
plugins: [
sveltekit(),
svg(),
{
name: 'generate-schema',
apply: 'build',
closeBundle() {
const directory = 'build/schemas';
fs.mkdirSync(directory, { recursive: true });
fs.writeFileSync(
path.join(directory, 'CursorTheme.json'),
JSON.stringify(CursorTheme, null, 2)
);
fs.writeFileSync(path.join(directory, 'Variant'), JSON.stringify(Variant, null, 2));
fs.writeFileSync(
path.join(directory, 'Animations.json'),
JSON.stringify(AnimationList, null, 2)
);
}
}
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
});