-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
47 lines (43 loc) · 897 Bytes
/
vite.config.ts
File metadata and controls
47 lines (43 loc) · 897 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
45
46
47
import { glob } from '@dephub/glob';
import { cwd } from '@dephub/path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
const entry = await glob(['src/**/*.ts'], {
absolute: true,
});
const dtsPlugin = dts({
entryRoot: 'src',
exclude: ['vite.config.ts', 'src/cli.ts'],
outDir: 'dist',
tsconfigPath: './tsconfig.json',
});
export default defineConfig({
build: {
emptyOutDir: true,
lib: {
entry,
},
minify: 'esbuild',
reportCompressedSize: true,
rollupOptions: {
external: ['*'],
output: [
{
dir: 'dist',
entryFileNames: '[name].js',
format: 'esm',
preserveModules: true,
preserveModulesRoot: 'src',
},
],
},
ssr: true,
target: 'esnext',
},
plugins: [dtsPlugin],
resolve: {
alias: {
'@': cwd('src'),
},
},
});