Skip to content

Commit

Permalink
fix: add __dirname and __filename to banner (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goodwin authored Sep 7, 2023
1 parent f7f5256 commit e296947
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/@eventual/compiler/src/eventual-bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ function esmPolyfillRequireBanner() {
return {
js: [
`import { createRequire as topLevelCreateRequire } from 'module'`,
`const require = topLevelCreateRequire(import.meta.url)`,
`const require = topLevelCreateRequire(import.meta.url)
import { fileURLToPath as topLevelFileURLToPath } from 'url';
import { dirname as topLevelDirname } from 'path';
var __filename = topLevelFileURLToPath(import.meta.url);
var __dirname = topLevelDirname(__filename);`,
].join("\n"),
};
}
Expand Down

0 comments on commit e296947

Please sign in to comment.