-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ts
More file actions
42 lines (38 loc) · 739 Bytes
/
build.ts
File metadata and controls
42 lines (38 loc) · 739 Bytes
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
const shared = {
entrypoints: ['src/index.ts'],
sourcemap: 'inline' as const,
minify: true,
external: ['@6over3/zeroperl-ts']
};
await Promise.all([
Bun.build({
...shared,
outdir: 'dist/esm',
format: 'esm',
target: 'browser',
naming: '[name].js',
}),
// CommonJS build for Node
Bun.build({
...shared,
outdir: 'dist/cjs',
format: 'cjs',
target: 'node',
naming: '[name].cjs',
}),
// Browser-only demo build
Bun.build({
...shared,
outdir: 'public',
format: 'esm',
target: 'browser',
minify: true,
entrypoints: ['index.html'],
external: ['node:*'],
naming: {
chunk: '[name].js',
asset: '[name].[ext]',
},
}),
]);
export {};