-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
84 lines (81 loc) · 1.79 KB
/
vite.config.ts
File metadata and controls
84 lines (81 loc) · 1.79 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
formats: ['es'] as const,
fileName: () => 'index.js',
},
rollupOptions: {
output: {
dir: resolve(__dirname, 'dist'),
format: 'es' as const,
preserveModules: false,
entryFileNames: '[name].js',
chunkFileNames: 'chunks/[name]-[hash].js',
},
external: [
// Node.js built-ins
/^node:/,
/^bun:/,
'fs',
'path',
'url',
'os',
'crypto',
'stream',
'util',
'events',
'child_process',
'buffer',
'Buffer',
'zlib',
'assert',
'http',
'https',
'net',
'tls',
'dns',
'cluster',
'worker_threads',
'perf_hooks',
'readline',
'repl',
'vm',
'v8',
'inspector',
// External dependencies - don't bundle these
'tesseract.js',
'@gutenye/ocr-node',
'pngjs',
'jpeg-js',
// SDK dependencies
'@happyvertical/utils',
/^@happyvertical\//,
],
},
minify: false,
sourcemap: true,
target: 'es2022',
reportCompressedSize: false,
},
plugins: [
dts({
outDir: resolve(__dirname, 'dist'),
include: [resolve(__dirname, 'src/**/*.ts')],
exclude: [
'**/*.test.ts',
'**/*.spec.ts',
'**/*.test.*.ts',
'**/*.config.ts',
'**/*.config.js',
'**/*.d.ts',
],
insertTypesEntry: false,
rollupTypes: false,
tsconfigPath: resolve(__dirname, 'tsconfig.json'),
}),
],
});