-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
69 lines (67 loc) · 1.64 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
66
67
68
69
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import { resolve } from 'path';
import { peerDependencies } from './package.json';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';
import swc from 'unplugin-swc';
export default defineConfig({
plugins: [
dts({
include: ['src/**/*'],
exclude: ['*.{test,spec}.*'],
tsconfigPath: './tsconfig.json',
rollupTypes: true,
}),
tsconfigPaths(),
// esbuild doesn't support a couple of features that nestjs requires, so instead
// we use swc. For example, see: https://github.com/nestjs/nest/issues/9228
swc.vite({
module: { type: 'es6' },
jsc: {
target: 'esnext',
parser: {
syntax: 'typescript',
decorators: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
keepClassNames: true,
preserveAllComments: true,
},
}),
],
ssr: {
target: 'node',
},
build: {
ssr: true,
minify: false,
lib: {
entry: {
main: resolve(__dirname, 'src/main.ts'),
},
name: '@spuxx/nest-testing',
formats: ['es'],
},
rollupOptions: {
external: [...Object.keys(peerDependencies)],
},
},
test: {
environment: 'node',
silent: true,
setupFiles: './tests/vitest.setup.ts',
reporters: ['default', 'junit'],
outputFile: 'reports/junit/junit.xml',
coverage: {
provider: 'v8',
all: true,
include: ['**/*.ts'],
reportsDirectory: 'reports/vitest/coverage',
reporter: ['text', 'json'],
},
},
});