-
Notifications
You must be signed in to change notification settings - Fork 1
/
esbuild.config.js
37 lines (33 loc) · 986 Bytes
/
esbuild.config.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
import esbuild from 'esbuild';
/** @type {import('esbuild/lib/main').BuildOptions} */
const options = {
entryPoints: ['./src/index.ts'],
bundle: true,
external: [
// Do not bundle eslint-remote-tester. Its modules should be required
// runtime from users eslint-remote-tester in order to avoid updating action.
'eslint-remote-tester',
// Externalize node built-ins
'diagnostics_channel',
'node:stream',
'node:util',
'node:events',
'node:fs',
'node:path',
],
platform: 'node',
format: 'esm',
outdir: 'dist',
outbase: 'src',
outExtension: { '.js': '.mjs' },
banner: {
js: [
`import { createRequire as topLevelCreateRequire } from 'module'`,
`const require = topLevelCreateRequire(import.meta.url)`,
].join('\n'),
},
};
esbuild.build(options).catch(err => {
process.stderr.write(err.stderr);
process.exit(1);
});