-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.ts
36 lines (30 loc) · 922 Bytes
/
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
/// <reference types="bun-types" />
import getExternalDependencies, { bunBuild } from '@enalmada/bun-externals';
import {
prependDirectiveToBuiltFiles,
removeBadClientStringFromFiles,
} from './prependClientDirective';
async function buildWithExternals(): Promise<void> {
const externalDeps = await getExternalDependencies();
await bunBuild({
entrypoints: [
'./src/index.ts',
'./src/layout/layout.tsx',
'./src/navbar/user-dropdown.tsx',
'./src/sidebar/sidebar.tsx',
],
outdir: './dist',
target: 'node',
external: [
...externalDeps,
'./src/layout/layout',
'./src/navbar/user-dropdown',
'./src/sidebar/sidebar',
],
root: './src',
});
// Update the built files in './dist/client' after the build completes.
prependDirectiveToBuiltFiles('./src', './dist');
removeBadClientStringFromFiles('./dist');
}
void buildWithExternals();