mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-18 09:40:38 +01:00
38ddfd61f3
* Add support to CommonJS * Fixes * Update CHANGELOG.md
15 lines
473 B
JavaScript
15 lines
473 B
JavaScript
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) })
|