-
Notifications
You must be signed in to change notification settings - Fork 35
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 ^^
…t-and-ship-it#807) * fix: only transpile ESM imports when entrypoint is ESM * chore: fix tests * chore: fix test on Windows
- 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)