Skip to content
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

Merged
merged 5 commits into from Nov 17, 2021

Conversation

eduardoboucas
Copy link
Member

- Summary

The shouldTranspile method was previously returning true 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)

sloth-1-102913

@eduardoboucas eduardoboucas added the type: bug code to address defects in shipped code label Nov 12, 2021
@@ -0,0 +1,10 @@
class App {
constructor(event, context) {
return {
Copy link
Contributor

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

Copy link
Contributor

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 ^^

Copy link
Member Author

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 {
Copy link
Contributor

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 ^^

@eduardoboucas eduardoboucas merged commit a1b0a15 into main Nov 17, 2021
@eduardoboucas eduardoboucas deleted the fix/nft-transpile-check branch November 17, 2021 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants