-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from beerose/local-esm
Support loading ES Modules
- Loading branch information
Showing
13 changed files
with
1,436 additions
and
809 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* istanbul ignore file -- @preserve */ | ||
let result: boolean; | ||
function canUseDynamicImport(): boolean { | ||
if (result === undefined) { | ||
try { | ||
new Function('id', 'return import(id);'); | ||
result = true; | ||
} catch (e) { | ||
result = false; | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
export { canUseDynamicImport }; |
Oops, something went wrong.