-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.html
53 lines (46 loc) · 1.53 KB
/
package.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@jspm/packages</title>
<link rel="stylesheet" href="css/style.css" />
<script>
window.esmsInitOptions = { polyfillEnable: ['css-modules', 'json-modules'] }
</script>
<script async src="https://ga.jspm.io/npm:es-module-shims@1.3.0/dist/es-module-shims.js"></script>
<script type="importmap" id="importmap">
{
"imports": {
"@jspm/packages/dom": "./dom/main.js",
"@jspm/packages/functions": "./functions/main.js"
},
"scopes": {
"./": {
"marked": "https://ga.jspm.io/npm:marked@4.0.5/lib/marked.esm.js",
"nano-jsx": "https://ga.jspm.io/npm:nano-jsx@0.0.25/lib/index.js"
}
}
}
</script>
</head>
<body>
<main id="root"></main>
<script type="module">
import { removeSlashes } from '@jspm/packages/functions';
const { pathname } = document.location;
//const [pathPrefix, ...packageName] = removeSlashes(pathname).split("/");
let packageName;
if (pathname.startsWith('/packages/')) {
packageName = pathname.substring(10);
if (packageName) {
document.title = `${document.title} – ${packageName}`
const { main } = await import('@jspm/packages/dom');
const mountDOMElement = document.getElementById('root');
main({ mountDOMElement, packageName });
}
}
</script>
</body>
</html>