-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (39 loc) · 1.03 KB
/
vite.config.ts
File metadata and controls
41 lines (39 loc) · 1.03 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
import { builtinModules } from 'node:module';
import checker from 'vite-plugin-checker';
import { defineConfig } from 'vitest/config';
const nodeBuiltins = builtinModules.flatMap(m => [m, `node:${m}`]);
export default defineConfig({
build: {
lib: {
entry: {
index: 'src/index.ts',
cleanup: 'src/cleanup.ts'
},
formats: ['es'],
fileName: (_format, entryName) => `${entryName}.js`
},
rolldownOptions: {
platform: "node",
external: nodeBuiltins,
checks: { pluginTimings: false },
experimental: { attachDebugInfo: "none" },
},
target: 'node24',
outDir: 'dist',
emptyOutDir: true
},
resolve: { conditions: ['node'] },
plugins: [checker({typescript: {root: '.'}})],
test: {
globals: true,
mockReset: true,
environment: 'node',
include: ['test/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
include: ['src/**/*.ts'],
exclude: ['src/index.ts', 'src/cleanup.ts'],
},
}
});