mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-06 01:10:40 +00:00
also expose internal shared functionality for external usage
This commit is contained in:
@@ -4,14 +4,28 @@ import { build, context } from 'esbuild'
|
||||
import pkg from '../package.json' assert { type: 'json' }
|
||||
|
||||
const options = {
|
||||
entryPoints: ['./src/index.ts'],
|
||||
entryPoints: ['./src/cli.ts'],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
platform: 'node',
|
||||
outfile: './dist/index.cjs',
|
||||
outfile: './dist/cli.cjs',
|
||||
define: { VERSION: `"${pkg.version}"` },
|
||||
}
|
||||
|
||||
const watch = process.argv.slice(2)[0] === '--watch'
|
||||
if (watch) (await context(options)).watch()
|
||||
else await build(options)
|
||||
if (watch) {
|
||||
;(await context(options)).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}"` },
|
||||
})
|
||||
}
|
||||
|
@@ -13,5 +13,5 @@ const targets = [
|
||||
|
||||
for (const target of targets) {
|
||||
console.log(`🚀 Building ${target}`)
|
||||
await exec(['./dist/index.cjs', '--target', target, '--output', `./bin/${target.replace('node18', 'cryptgeon')}`])
|
||||
await exec(['./dist/cli.cjs', '--target', target, '--output', `./bin/${target.replace('node18', 'cryptgeon')}`])
|
||||
}
|
||||
|
Reference in New Issue
Block a user