New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: only transpile ESM imports when entrypoint is ESM #807
Conversation
@@ -0,0 +1,10 @@ | |||
class App { | |||
constructor(event, context) { | |||
return { |
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.
wait, what? Constructors can return something? this weird
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.
but fine for a fixture, I guess ^^
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.
The idea was to replicate this scenario, but using a class or not is actually irrelevant for the test case here. All that matters is that the file is ESM.
@@ -0,0 +1,10 @@ | |||
class App { | |||
constructor(event, context) { | |||
return { |
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.
but fine for a fixture, I guess ^^
- Summary
The
shouldTranspile
method was previously returningtrue
for any path that doesn't have a parent, where in reality it must do so only if the path itself is an ESM file.- Test plan
A new test was added to verify this scenario.
- A picture of a cute animal (not mandatory but encouraged)