-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundler.ts
38 lines (31 loc) · 985 Bytes
/
bundler.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
38
import dts from 'bun-plugin-dts';
import pkg from './package.json';
const dependencies = 'dependencies' in pkg ? Object.keys(pkg.dependencies ?? {}) : [];
const devDependencies = 'devDependencies' in pkg ? Object.keys(pkg.devDependencies ?? {}) : [];
const peerDependencies = 'peerDependencies' in pkg ? Object.keys(pkg.peerDependencies ?? {}) : [];
await Bun.build({
target: 'node',
external: [...dependencies, ...devDependencies, ...peerDependencies],
root: './source',
entrypoints: [
'./source/core/index.ts',
'./source/core/strategy/index.ts',
'./source/error/index.ts',
'./source/error/key/index.ts',
'./source/i18n/index.ts',
'./source/types/index.ts',
'./source/index.ts'
],
plugins: [
dts({
output: {
noBanner: true
}
})
],
outdir: './build',
splitting: true,
format: 'esm',
minify: true,
sourcemap: 'none'
});