Skip to content

Commit

Permalink
update ESM example
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 18, 2024
1 parent 3ec909f commit fced4fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/esm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
<script type="module">
// wait for Service Woker
await window.ready;
// next tick delay is require for the worker to intitialize properly
await new Promise(resolve => setTimeout(resolve, 0));

// static imports works only when you install and refresh the browser
// they probbaly run just after the code is parsed
const { default: $ } = await import('./@jquery');

import terminal from './@jquery.terminal';
const $ = terminal(window);
const css = './@jquery.terminal/css/jquery.terminal.min.css'
$(`<link href="${css}" rel="stylesheet"/>`).appendTo('head');
$('body').terminal();
$('body').terminal();
</script>
</body>
</html>

0 comments on commit fced4fb

Please sign in to comment.