-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix loader cyclical dependency bug (#36)
fixes loader cyclical dependency bug by forgoing module wrapping of file and embedding file contents within the patch instead. To ensure the patch still works when embedding file content an AST is generated to make modifications to the file contents. The general flow is file content -> AST -> update const named exports to let & add a name to any non named default export -> regenerate file contents using updated AST -> embed the file contents in the patch. Recast (https://github.com/benjamn/recast) is used as the AST transformer & code generator of choice since it seems to be great at maintaining original file content structure & thus subsequently maintaining original file stack trace. Although the use of source maps might be better. This PR aims to solve this issue: DataDog/dd-trace-js#3595
- Loading branch information
1 parent
16115e9
commit 4df8a29
Showing
34 changed files
with
649 additions
and
64 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
Oops, something went wrong.