napi-rs/cli/esbuild.mjs
LongYinan e9835c4e75
chore(cli): link npm cli issues in native binding load errors (#2707)
* chore(cli): link npm cli issues in native binding load errors

* run fmt
2025-06-11 12:02:19 -07:00

21 lines
425 B
JavaScript

import { build } from 'esbuild'
import { pull } from 'lodash-es'
import packageJson from './package.json' with { type: 'json' }
await build({
entryPoints: ['./dist/index.js'],
outfile: './dist/index.cjs',
bundle: true,
format: 'cjs',
platform: 'node',
external: pull(
Object.keys(packageJson.dependencies),
'@octokit/rest',
'lodash-es',
),
define: {
'import.meta.url': '__filename',
},
})