mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 05:20:46 +08:00
24 lines
676 B
JavaScript
24 lines
676 B
JavaScript
import { mkdir } from 'node:fs/promises';
|
|
import { dirname, resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { build } from 'esbuild';
|
|
|
|
const sourceDirectory = dirname(fileURLToPath(import.meta.url));
|
|
const packageRoot = resolve(sourceDirectory, '../..');
|
|
const outputPath = resolve(packageRoot, 'lib/index.js');
|
|
|
|
await mkdir(dirname(outputPath), { recursive: true });
|
|
await build({
|
|
entryPoints: [resolve(sourceDirectory, 'index.mjs')],
|
|
bundle: true,
|
|
format: 'esm',
|
|
platform: 'node',
|
|
target: ['node22'],
|
|
packages: 'external',
|
|
outfile: outputPath,
|
|
sourcemap: false,
|
|
legalComments: 'none',
|
|
});
|
|
|
|
console.log(`Wrote ${outputPath}`);
|