Static Import Snippet

Our `basicjs.html` uses `eval()` to run javascript snippets and therefore cannot use static import declarations. We offer `importjs.html` which uses a clever mix of `import()` and a data url instead of `eval()`, thereby permitting static imports.

Here we offer to sprinkle confetti in the frame.

Provide a string with "export default" to tell the snippet runner how to display simple results.

import canvasConfetti from "https://cdn.skypack.dev/canvas-confetti" canvasConfetti() export default "<h2>Ta-da!</h2>"

Our first frame uses basicjs.html . No confetti.

//wiki.ralfbarkow.ch/assets/pages/js-snippet-template/basicjs.html HEIGHT 75

Our second frame uses importjs.html .

//wiki.ralfbarkow.ch/assets/pages/js-snippet-template/importjs.html HEIGHT 75