forked from rootCircle/docFiller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder.ts
More file actions
33 lines (28 loc) · 749 Bytes
/
builder.ts
File metadata and controls
33 lines (28 loc) · 749 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
import copyContents from './copier';
import entryPoints from './entrypoints';
const build = async () => {
const entrypoints = await entryPoints();
const buildStatus = await Bun.build({
entrypoints: entrypoints,
outdir: './build',
minify: true,
target: 'browser',
});
await copyContents('./public', './build');
if (!buildStatus.success) {
console.error('Build failed');
for (const message of buildStatus.logs) {
console.error(message);
}
throw new Error('Error building the ts files!');
}
};
const runBuild = async () => {
try {
await build();
console.log('Build completed successfully.');
} catch (error) {
console.error('Build failed:', error);
}
};
export default runBuild;