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

First pass test matches ES6 modules as CommonJS modules making namedExports unusable #36

Closed
qgustavor opened this issue Jan 30, 2016 · 1 comment

Comments

@qgustavor
Copy link

From the source the first time test detects using an simple regular expression could be a CommonJS module, trying to find expressions like "require" and "exports". As it's a simple test sometimes it matches those expressions in strings and comments (example: "required" from Apache License), making it try to transform the file as a CommonJS module.

When transforming the file it ends up not finding any exports and normally it returns null, except when namedExports is used. Maybe it can be changed to a warning and/or the first pass test me improved in some way to ignore strings and comments.

@Rich-Harris
Copy link
Contributor

Thanks! Was a simple typo – fixed in 2.2.1.

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

No branches or pull requests

2 participants