-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Synchronous installation of import map, when possible. Resolves #2 * Self review
- Loading branch information
1 parent
d5afcd8
commit c0757b2
Showing
4 changed files
with
195 additions
and
68 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
File renamed without changes.
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,38 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
<script type="injector-importmap"> | ||
{ | ||
"imports": { | ||
"basic": "./overridden-url.js", | ||
"basic2": "./basic2.js" | ||
} | ||
} | ||
</script> | ||
<script type="injector-importmap"> | ||
{ | ||
"imports": { | ||
"basic": "./basic.js" | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<script src="../lib/import-map-injector.js"></script> | ||
<!-- Loading via mapped specifier in <script> isn't supported yet by browsers, so we load by url instead --> | ||
<script type="module" src="./basic.js"></script> | ||
<script type="module" src="./basic2.js"></script> | ||
<script> | ||
window.importMapInjector.initPromise.then(async () => { | ||
// Load modules via specifier | ||
await Promise.all([import("basic"), import("basic2")]); | ||
console.log( | ||
"Import Map Injector ready, import map specifiers can be loaded properly", | ||
); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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