Skip to content

Commit 15c5138

Browse files
committed
Use import map.
1 parent e89d785 commit 15c5138

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pages/_page.xnode

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<link rel="icon" type="image/png" href="/_static/icon.png" />
1616
<link rel="stylesheet" href="/_static/site.css" type="text/css" media="screen" />
1717

18+
<script type="importmap" src="/_components/map.json"></script>
19+
1820
<script src="/_components/jquery/jquery.min.js"></script>
1921
<script src="/_components/jquery-syntax/jquery.syntax.min.js"></script>
2022

@@ -28,9 +30,9 @@
2830
//]]>
2931
</script>
3032

31-
<script type="module">
33+
<script type="module">
3234
// <![CDATA[
33-
import mermaid from '/_components/mermaid/mermaid.esm.min.mjs';
35+
import mermaid from 'mermaid';
3436
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
3537
const theme = isDarkMode ? 'dark' : 'default';
3638
mermaid.initialize({startOnLoad: true, theme: theme});

public/_components/map.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"imports": {
3+
"mermaid": "./mermaid/mermaid.esm.min.mjs"
4+
}
5+
}

0 commit comments

Comments
 (0)