forked from skeletonlabs/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
32 lines (29 loc) · 768 Bytes
/
vite.config.js
File metadata and controls
32 lines (29 loc) · 768 Bytes
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
import { sveltekit } from '@sveltejs/kit/vite';
import { configDefaults } from 'vitest/config';
import path from 'path';
// Import package.json version
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const pkg = JSON.parse(json);
/** @type {import('vite').UserConfig} */
const config = {
plugins: [
sveltekit({ hot: !process.env.VITEST }),
],
define: {
'__PACKAGE__': pkg
},
resolve: {
alias: {
'@brainandbones/skeleton': path.resolve('./src/lib/index.ts')
}
},
test: {
globals: true,
environment: 'jsdom',
exclude: [...configDefaults.exclude, '**/package/**', '**/build/**']
},
};
export default config;