Skip to content

Commit

Permalink
Fix cli error (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroki0525 authored Nov 24, 2023
1 parent e990fd2 commit 6388842
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-kings-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dandori/cli": patch
---

fix cli error
10 changes: 10 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@ export default defineConfig({
dts: true,
format: ["esm"],
entry: ["src", "!src/**/*.test.*", "!src/**__test__/**"],
platform: "node",
banner: {
// Error: "Dynamic require of "os" is not supported"
// Solution: https://github.com/evanw/esbuild/issues/1921#issuecomment-1623640043
js: `
const require = (await import("node:module")).createRequire(import.meta.url);
const __filename = (await import("node:url")).fileURLToPath(import.meta.url);
const __dirname = (await import("node:path")).dirname(__filename);
`,
},
});

0 comments on commit 6388842

Please sign in to comment.