-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbuild.ts
More file actions
38 lines (26 loc) · 1016 Bytes
/
build.ts
File metadata and controls
38 lines (26 loc) · 1016 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
import * as path from 'node:path'
import * as url from 'node:url'
import * as esb from 'esbuild'
import * as build from '../../build_shared.ts'
const filename = url.fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const src_dirname = path.join(dirname, `src`)
const dist_dirname = path.join(dirname, `dist`)
const entry_index_filename = path.join(src_dirname, `index.ts`)
const entry_server_filename = path.join(src_dirname, `server.ts`)
const pkg_filename = path.join(dirname, 'package.json')
export default () => {
const external = build.get_external_deps_from_pkg(pkg_filename)
const is_dev = build.get_is_dev_from_args()
const common = build.get_common_esbuild_options(is_dev, dist_dirname)
const entries = [
entry_index_filename,
entry_server_filename,
]
const esb_options: esb.BuildOptions[] = [{
...common,
entryPoints: entries,
external: external,
}]
return esb_options
}