mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
feat: add support to CommonJS (#519)
* Add support to CommonJS * Fixes * Update CHANGELOG.md
This commit is contained in:
parent
731f553607
commit
38ddfd61f3
7 changed files with 679 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: 'node16',
|
||||
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