Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Handle missing default export even if first pass matched #285

Merged
merged 1 commit into from
Mar 5, 2018

Conversation

adrianheine
Copy link
Contributor

Closes #255.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,2 @@
// Great module
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Took me some time to figure out what was going on here so I'll just write it down for future reference:

  • The CJS plugin is first doing a quick regexp check to see if a module could be CJS. This check is just looking for keywords such as module
  • If the check matches, the transform function repeats this test using an actual AST
  • Modules that are not CJS specific were treated differently if the first or if the second check was successful. This is fixed by this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants