-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to make the error nicer when mixing ESM and CommonJS
We define `module` and `exports` on the global object, so that *if* the executed code isn't part of CommonJS which defines them, it will access the global ones. The global ones just error out on access with a message pointing out that this likely is due to mixing CommonJS and ESM.
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters