-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
65 lines (63 loc) · 1.82 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
import loadVersion from 'vite-plugin-package-version';
import solidPlugin from 'vite-plugin-solid';
import { configDefaults } from 'vitest/config';
const testDef = {
test: {
exclude: [...configDefaults.exclude, './build/**', './dist/**'],
coverage: {
enabled: true,
reporter: ['html'],
extension: ['.ts'],
include: ['src'],
exclude: [
'src/api/api.ts',
'src/api/types',
'src/api/contracts',
'src/constants',
'src/contracts',
'src/data',
'src/services/external',
'src/services/internal/apiFileService.ts',
'src/web/contracts',
'src/web/hooks',
'src/web/types',
],
},
},
};
export default defineConfig({
...testDef,
plugins: [loadVersion(), solidPlugin()],
server: {
port: 3000,
// host: 'test.nmsud.com',
},
build: {
target: 'esnext',
// rollupOptions: {
// external: [new RegExp('/api/.*')],
// },
},
resolve: {
alias: [
{ find: '@api', replacement: fileURLToPath(new URL('./src/api', import.meta.url)) },
{ find: '@web', replacement: fileURLToPath(new URL('./src/web', import.meta.url)) },
{
find: '@constants',
replacement: fileURLToPath(new URL('./src/constants', import.meta.url)),
},
{
find: '@contracts',
replacement: fileURLToPath(new URL('./src/contracts', import.meta.url)),
},
{ find: '@helpers', replacement: fileURLToPath(new URL('./src/helpers', import.meta.url)) },
{ find: '@services', replacement: fileURLToPath(new URL('./src/services', import.meta.url)) },
{
find: '@validation',
replacement: fileURLToPath(new URL('./src/validation', import.meta.url)),
},
],
},
});