forked from evanw/esbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
module.exports
assigment to the top
When using cjs format make sure to move `module.exports` to the top of the generated chunk, right after the `__export()` call: var exports = {}; __export(exports, { // ... }); module.exports = __toCommonJS(exports); This guarantees that all circular requires following these calls would see the correct `module.exports` object. Additionally, add an extra argument for `__reExport` to copy the data to the `module.exports`: __reExport(exports, module.exports, ...) This is required to support `export * from '..'` since now `module.exports` wouldn't automatically receive properties otherwise. Fix: evanw#1894
- Loading branch information
Showing
6 changed files
with
71 additions
and
53 deletions.
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
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
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
Oops, something went wrong.