-
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.
Reuse dynamicImport workaround by @TomerAberbach due to microsoft/TypeScript#43329 for escape-string-regexp as well
- Loading branch information
Showing
3 changed files
with
16 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Workaround for https://github.com/microsoft/TypeScript/issues/43329. | ||
* | ||
* TypeScript will always try to replace dynamic imports with requires` which doesn't work for importing ESM from CJS. | ||
* We work around by "hiding" our dynamic import in a Function constructor (terrible...) | ||
*/ | ||
export default new Function('moduleName', 'return import(moduleName)') |
This file was deleted.
Oops, something went wrong.