mirror of
https://github.com/makenotion/notion-mcp-server.git
synced 2026-02-19 15:14:11 -05:00
31 lines
811 B
JavaScript
31 lines
811 B
JavaScript
import * as esbuild from 'esbuild';
|
|
import { chmod } from 'fs/promises';
|
|
import { fileURLToPath } from 'url';
|
|
import { dirname, join } from 'path';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
async function build() {
|
|
await esbuild.build({
|
|
entryPoints: [join(__dirname, 'start-server.ts')],
|
|
bundle: true,
|
|
minify: true,
|
|
platform: 'node',
|
|
target: 'node18',
|
|
format: 'esm',
|
|
outfile: 'bin/cli.mjs',
|
|
banner: {
|
|
js: "#!/usr/bin/env node\nimport { createRequire } from 'module';const require = createRequire(import.meta.url);" // see https://github.com/evanw/esbuild/pull/2067
|
|
},
|
|
external: ['util'],
|
|
});
|
|
|
|
// Make the output file executable
|
|
await chmod('./bin/cli.mjs', 0o755);
|
|
}
|
|
|
|
build().catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|