chore: external all dependencies in cli cjs build (#2166)

This commit is contained in:
LongYinan 2024-07-06 14:11:21 +08:00 committed by GitHub
parent 286c8d0cf4
commit a7ef9be9ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,14 @@
import * as esbuild from 'esbuild'
import packageJson from './package.json' assert { type: 'json' }
await esbuild.build({
entryPoints: ['./dist/index.js'],
outfile: './dist/index.cjs',
bundle: true,
format: 'cjs',
platform: 'node',
external: ['@napi-rs/lzma', '@napi-rs/tar', '@napi-rs/wasm-tools'],
external: Object.keys(packageJson.dependencies),
define: {
'import.meta.url': '__filename',
},