Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only transpile ESM imports when entrypoint is ESM (#807)
* fix: only transpile ESM imports when entrypoint is ESM * chore: fix tests * chore: fix test on Windows
- Loading branch information
1 parent
f075205
commit a1b0a15
Showing
4 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exports.handler = async (event, context) => { | ||
const { App } = await import('./lib/file.mjs') | ||
return new App(event, context) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class App { | ||
constructor(event, context) { | ||
return { | ||
statusCode: 200, | ||
body: 'Hello world', | ||
} | ||
} | ||
} | ||
|
||
export { App } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1b0a15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱ Benchmark results
largeDepsEsbuild: 7.9s
largeDepsNft: 51.8s
largeDepsZisi: 1m 3.7s