Skip to content

Commit

Permalink
fix: adds banner to solve fs import issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mihirgupta0900 committed Sep 13, 2023
1 parent 41ab9aa commit bfc1270
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-mirrors-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tsup-subpath-exports": patch
---

Fixes fs import issues
10 changes: 10 additions & 0 deletions packages/multiple-entry/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@ export default defineConfig({
format: ["cjs", "esm"],
clean: true,
dts: true,
banner: {
js: `
// https://github.com/evanw/esbuild/issues/1921#issuecomment-1491470829
import { fileURLToPath } from 'url';
import { createRequire as topLevelCreateRequire } from 'module';
const require = topLevelCreateRequire(import.meta.url);
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
`,
},
});

0 comments on commit bfc1270

Please sign in to comment.