-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
40 lines (33 loc) · 853 Bytes
/
build.js
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
39
40
import { createRequire } from 'node:module';
import { build } from 'esbuild';
const require = createRequire(import.meta.url);
const { version } = require('./package.json');
const banners = [
'#!/usr/bin/env node',
`process.env.APP_VERSION = ${JSON.stringify(version)};`,
];
const config = {
bundle: true,
minify: false,
format: 'cjs',
packages: 'external',
platform: 'node',
banner: {
js: banners.join('\n'),
},
};
build({
...config,
entryPoints: ['src/commands/addBadge.ts'],
outfile: 'bin/add-badge.cjs',
}).catch(() => process.exit(1));
build({
...config,
entryPoints: ['src/commands/addBadges.ts'],
outfile: 'bin/add-badges.cjs',
}).catch(() => process.exit(1));
build({
...config,
entryPoints: ['src/commands/generateSamples.ts'],
outfile: 'bin/generate-samples.cjs',
}).catch(() => process.exit(1));