-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathvite.config.ts
51 lines (48 loc) · 1.16 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
import { resolve } from 'node:path';
import tsConfigPaths from 'vite-tsconfig-paths';
import { externalizeDeps } from 'vite-plugin-externalize-deps';
import dtsPlugin from 'vite-plugin-dts';
import { glob } from 'glob';
const rootDir = 'src';
/** @type {import('vite').UserConfig} */
export default {
test: {
globals: true,
passWithNoTests: true,
testTimeout: 15_000,
setupFiles: ['./tests/setup.ts'],
deps: {
interopDefault: false
}
},
build: {
minify: false,
target: 'node22.2.0',
outDir: './dist',
lib: {
entry: [
...glob.sync(resolve(__dirname, 'src/**/*.ts')),
...glob.sync(resolve(__dirname, 'workers/node/**/*.ts')),
...glob.sync(resolve(__dirname, 'seeders/**/*.ts'))
],
formats: ['es']
},
rollupOptions: {
output: {
preserveModules: true,
preserveModulesRoot: rootDir
}
}
},
resolve: {
alias: {
'@/': resolve(resolve(__dirname), rootDir),
'@tests/': resolve(resolve(__dirname), 'tests')
}
},
plugins: [
tsConfigPaths(),
dtsPlugin({ entryRoot: rootDir, pathsToAliases: true }),
externalizeDeps()
]
};