diff --git a/scripts/esb.mjs b/scripts/esb.mjs index 3a200c0..1070ac1 100644 --- a/scripts/esb.mjs +++ b/scripts/esb.mjs @@ -13,7 +13,7 @@ const formatMetafile = (metafile, verbose = true) => { }; const result = await esbuild.build({ - entryPoints: ["src/main.ts"], + entryPoints: ["src/index.ts"], bundle: true, outfile: "bin/index.mjs", minify: true, diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..3376991 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +import { main } from "./main.js"; + +main(); diff --git a/src/main.ts b/src/main.ts index a60afc4..af71c2c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,3 @@ -#!/usr/bin/env node - import { dirname, sep, resolve as pathResolve } from "node:path"; import { fileURLToPath } from "node:url"; @@ -247,4 +245,4 @@ const end = async () => { logger.timeEnd("create-hexo"); }; -main(); +export { main };