-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ts
37 lines (36 loc) · 1.08 KB
/
build.ts
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
import bun from 'bun';
try {
console.info('Starting the build process...');
const outputNode = await bun.build({
entrypoints: ['src/index.ts'],
outdir: 'dist',
format: 'esm',
minify: true,
sourcemap: 'external',
target: 'browser',
// target: 'esnext', // Adjust target based on your project needs
});
console.info('Node Build completed successfully!', outputNode);
const outputFile = await bun.build({
entrypoints: ['src/file.ts'],
outdir: 'dist',
format: 'esm',
minify: true,
sourcemap: 'external',
target: 'node',
// target: 'esnext', // Adjust target based on your project needs
});
console.info('File Build completed successfully!', outputFile);
const outputMMap = await bun.build({
entrypoints: ['src/mmap.ts'],
outdir: 'dist',
format: 'esm',
minify: true,
sourcemap: 'external',
target: 'node',
// target: 'esnext', // Adjust target based on your project needs
});
console.info('File Build completed successfully!', outputMMap);
} catch (error) {
console.error('Build failed:', error);
}