-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathvite.config.ts
More file actions
64 lines (63 loc) · 1.78 KB
/
vite.config.ts
File metadata and controls
64 lines (63 loc) · 1.78 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
/// <reference types='vitest' />
import { defineConfig } from 'vitest/config';
import { resolve } from 'node:path';
import dts from 'vite-plugin-dts';
export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/pkgs/client',
plugins: [
dts({
include: ['src/**/*.ts'],
outDir: 'dist',
rollupTypes: false, // Don't bundle for now
insertTypesEntry: true,
// Don't specify tsConfigFilePath - let the plugin find tsconfig.json naturally
// This avoids the rootDir issue by not forcing it to use tsconfig.lib.json
skipDiagnostics: true, // Skip diagnostics since Nx runs tsc separately
compilerOptions: {
// Override composite to false just for declaration generation
// This allows dts plugin to traverse into dependency packages
composite: false
}
})
],
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'PgflowClient',
fileName: 'index',
// Only generate ES module
formats: ['es']
},
rollupOptions: {
// External dependencies that shouldn't be bundled
external: [
'@pgflow/core',
'@pgflow/dsl',
'@supabase/supabase-js',
'nanoevents',
'uuid'
],
output: {
// Preserve the existing export structure
exports: 'named'
}
},
sourcemap: true,
emptyOutDir: false, // Don't empty the directory to preserve browser build
},
test: {
watch: false,
globals: true,
environment: 'node',
include: [
'__tests__/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'
],
setupFiles: ['__tests__/setup.ts'],
reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/pkgs/client',
provider: 'v8',
},
},
});