With ES Modules, you can natively import other JavaScript. Like confetti, duh:import confetti from 'https://cdn.skypack.dev/canvas-confetti'; confetti();That import statement is just gonna run. There is a pattern to do it conditionally though. It’s like this: if (condition) { // await import("stuff.js"), confetti; });

Post cover image
2 Comments

Sort: