Fix import errors

This commit is contained in:
Sidharth Vinod 2022-09-14 12:01:47 +05:30
parent bb413e0022
commit ac629c91d6
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
3 changed files with 7 additions and 4 deletions

View File

@ -13,8 +13,8 @@ build(iifeBuild({ minify: false, watch })).catch(handler);
build(esmBuild({ minify: false, watch })).catch(handler);
// mermaid.min.js
build(esmBuild()).catch(handler);
// mermaid.esm.min.mjs
build(iifeBuild()).catch(handler);
// mermaid.esm.min.mjs
build(esmBuild()).catch(handler);
// mermaid.core.mjs (node_modules unbundled)
build(esmCoreBuild()).catch(handler);

View File

@ -83,6 +83,9 @@ exports.iifeBuild = (override = { minify: true }) => {
return buildOptions({
entryPoints: getEntryPoints(override.minify ? '.min' : ''),
format: 'iife',
footer: {
js: 'mermaid = mermaid.default;',
},
...override,
});
};

View File

@ -23,8 +23,8 @@ ORDER ||--|{ LINE-ITEM : contains
CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
</pre>
<script src="./mermaid.esm.mjs" type="module"></script>
<script>
<script type="module">
import mermaid from './mermaid.esm.mjs';
mermaid.initialize({
theme: 'forest',
// themeCSS: '.node rect { fill: red; }',