-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtsup.config.ts
More file actions
40 lines (39 loc) · 1.01 KB
/
tsup.config.ts
File metadata and controls
40 lines (39 loc) · 1.01 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
import { defineConfig } from 'tsup';
export default defineConfig([
{
entryPoints: ['src/index.ts', 'src/utils/worker.ts'],
format: ['cjs', 'esm'],
dts: {
resolve: true,
},
minify: false,
outDir: 'dist/',
clean: true,
sourcemap: false,
bundle: true,
splitting: false,
outExtension(ctx) {
return {
dts: '.d.ts',
js: ctx.format === 'cjs' ? '.cjs' : '.mjs',
};
},
treeshake: false,
target: 'es2022',
platform: 'node',
tsconfig: './tsconfig.json',
shims: true,
cjsInterop: true,
keepNames: true,
skipNodeModulesBundle: true,
// Mark native modules and Node.js built-ins as external
external: [
'koffi',
'piscina',
'worker_threads',
'node:*',
// Explicitly exclude all native modules
/\.node$/,
],
},
]);