mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
Add support to CommonJS
This commit is contained in:
parent
0bf6645921
commit
91a38084d2
6 changed files with 678 additions and 4 deletions
15
tools/esbuild.js
Normal file
15
tools/esbuild.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { build } from 'esbuild'
|
||||
import { nodeExternalsPlugin } from 'esbuild-node-externals'
|
||||
|
||||
const buildConfig = {
|
||||
entryPoints: ['lib/index.js'],
|
||||
platform: 'node',
|
||||
target: 'node14',
|
||||
bundle: true,
|
||||
outfile: 'dist/index.cjs',
|
||||
format: 'cjs',
|
||||
// got is a esm module, so we need to add it to the allowList, to include it in the bundle.
|
||||
plugins: [nodeExternalsPlugin({ allowList: ['got'] })]
|
||||
}
|
||||
|
||||
build(buildConfig).then(() => { }).catch(() => { process.exit(1) })
|
||||
Loading…
Add table
Add a link
Reference in a new issue