Skip to content

Commit

Permalink
fix: adjust the entrance
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Jan 2, 2024
1 parent 09dd0e0 commit 57b5121
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/esb.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

import { main } from "./main.js";

main();
4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

import { dirname, sep, resolve as pathResolve } from "node:path";
import { fileURLToPath } from "node:url";

Expand Down Expand Up @@ -247,4 +245,4 @@ const end = async () => {
logger.timeEnd("create-hexo");
};

main();
export { main };

0 comments on commit 57b5121

Please sign in to comment.