chore: Add esbuild (Breaking change)

mermaid.min.js and mermaid.js will now be IIFE instead of UMD.
This commit is contained in:
Sidharth Vinod
2023-08-13 18:33:41 +05:30
parent 43217e1395
commit da7ff777d1
31 changed files with 1121 additions and 470 deletions

View File

@@ -0,0 +1,29 @@
<html>
<body>
<pre id="diagram" class="mermaid">
graph TB
a --> b
a --> c
b --> d
c --> d
</pre>
<div id="d2"></div>
<script src="/mermaid.min.js"></script>
<script>
mermaid.initialize({
startOnLoad: true,
});
const value = `graph TD\nHello --> World`;
const el = document.getElementById('d2');
mermaid.render('did', value).then(({ svg }) => {
console.log(svg);
el.innerHTML = svg;
if (window.Cypress) {
window.rendered = true;
}
});
</script>
</body>
</html>