mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-06 01:10:40 +00:00
rm pkg and update node version
This commit is contained in:
@@ -3,29 +3,32 @@
|
||||
import { build, context } from 'esbuild'
|
||||
import pkg from '../package.json' assert { type: 'json' }
|
||||
|
||||
const options = {
|
||||
entryPoints: ['./src/cli.ts'],
|
||||
const common = {
|
||||
bundle: true,
|
||||
minify: true,
|
||||
platform: 'node',
|
||||
outfile: './dist/cli.cjs',
|
||||
define: { VERSION: `"${pkg.version}"` },
|
||||
}
|
||||
|
||||
const cliOptions = {
|
||||
...common,
|
||||
entryPoints: ['./src/cli.ts'],
|
||||
format: 'cjs',
|
||||
outfile: './dist/cli.cjs',
|
||||
}
|
||||
|
||||
const indexOptions = {
|
||||
...common,
|
||||
entryPoints: ['./src/index.ts'],
|
||||
outfile: './dist/index.mjs',
|
||||
format: 'esm',
|
||||
}
|
||||
|
||||
const watch = process.argv.slice(2)[0] === '--watch'
|
||||
if (watch) {
|
||||
;(await context(options)).watch()
|
||||
const ctx = await context(cliOptions)
|
||||
ctx.watch()
|
||||
} else {
|
||||
await build(options)
|
||||
|
||||
// Also build internals to expose
|
||||
await build({
|
||||
entryPoints: ['./src/index.ts'],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
platform: 'node',
|
||||
format: 'esm',
|
||||
outfile: './dist/index.js',
|
||||
define: { VERSION: `"${pkg.version}"` },
|
||||
})
|
||||
await build(cliOptions)
|
||||
await build(indexOptions)
|
||||
}
|
||||
|
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { exec } from 'pkg'
|
||||
|
||||
const targets = [
|
||||
'node18-macos-arm64',
|
||||
'node18-macos-x64',
|
||||
'node18-linux-arm64',
|
||||
'node18-linux-x64',
|
||||
'node18-win-arm64',
|
||||
'node18-win-x64',
|
||||
]
|
||||
|
||||
for (const target of targets) {
|
||||
console.log(`🚀 Building ${target}`)
|
||||
await exec(['./dist/cli.cjs', '--target', target, '--output', `./bin/${target.replace('node18', 'cryptgeon')}`])
|
||||
}
|
Reference in New Issue
Block a user