-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
38 lines (36 loc) · 1.06 KB
/
tsdown.config.ts
File metadata and controls
38 lines (36 loc) · 1.06 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
import { defineConfig, type UserConfig } from 'tsdown';
import { copyFileSync, rmSync } from 'node:fs';
const tsdownConfig: UserConfig[] = [
defineConfig({
target: 'es2023',
entry: ['src/index.js', 'src/node.js', 'src/index.d.ts', 'src/bin/sqlite3-worker1.mjs'],
format: ['esm'],
minify: 'dce-only',
outputOptions: {
comments: {
legal: true,
},
},
onSuccess: () => {
copyFileSync('./src/bin/sqlite3.wasm', './dist/sqlite3.wasm');
copyFileSync('./dist/bin/sqlite3-worker1.mjs', './dist/sqlite3-worker1.mjs');
},
}),
defineConfig({
target: 'es2023',
entry: ['src/bin/sqlite3-opfs-async-proxy.js'],
format: ['iife'],
minify: 'dce-only',
outputOptions: {
comments: {
legal: true,
},
},
onSuccess: () => {
copyFileSync('./dist/sqlite3-opfs-async-proxy.iife.js', './dist/sqlite3-opfs-async-proxy.js');
rmSync('./dist/sqlite3-opfs-async-proxy.iife.js');
rmSync('./dist/bin', { recursive: true, force: true });
},
}),
];
export default tsdownConfig;