-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.mts
More file actions
44 lines (43 loc) · 1005 Bytes
/
vite.config.mts
File metadata and controls
44 lines (43 loc) · 1005 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
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import swc from 'unplugin-swc';
import { externalizeDeps } from 'vite-plugin-externalize-deps';
export default defineConfig({
plugins: [
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({
jsc: {
parser: {
syntax: 'typescript',
decorators: true,
dynamicImport: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
},
sourceMaps: true,
}),
externalizeDeps(),
],
ssr: {
target: 'node',
noExternal: ['dotenv'],
},
build: {
target: 'node',
outDir: 'dist',
ssr: true,
rollupOptions: {
treeshake: {
preset: 'smallest',
},
input: {
main: './src/main.ts',
},
},
},
});