Skip to content

Commit 4a4f9e9

Browse files
committed
update: Switched to esbuild
1 parent 9965979 commit 4a4f9e9

10 files changed

+650
-303
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'plugin:@typescript-eslint/recommended',
99
'prettier',
1010
],
11-
ignorePatterns: ['build/', 'bin/'],
11+
ignorePatterns: ['bin/'],
1212
overrides: [],
1313
parserOptions: {
1414
ecmaVersion: 'latest',

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.idea
22
bin
3-
build
43
coverage
54
node_modules

build.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
3+
const { build } = require('esbuild');
4+
const { version } = require('./package.json');
5+
6+
const banners = [
7+
'#!/usr/bin/env node',
8+
`process.env.APP_VERSION = ${JSON.stringify(version)};`,
9+
];
10+
11+
const config = {
12+
bundle: true,
13+
minify: false,
14+
packages: 'external',
15+
platform: 'node',
16+
banner: {
17+
js: banners.join('\n'),
18+
},
19+
};
20+
21+
build({
22+
...config,
23+
entryPoints: ['src/commands/addBadge.ts'],
24+
outfile: 'bin/add-badge.js',
25+
}).catch(() => process.exit(1));
26+
27+
build({
28+
...config,
29+
entryPoints: ['src/commands/addBadges.ts'],
30+
outfile: 'bin/add-badges.js',
31+
}).catch(() => process.exit(1));

0 commit comments

Comments
 (0)