Macro link_to

macro_rules! link_to { ... }

This macro takes a JS module as input and returns a URL that can be used to access it at runtime.

The module can be specified in a few ways:

The returned URL can be used for things like creating workers/worklets:

use web_sys::Worker;
let worker = Worker::new(&wasm_bindgen::link_to!(module = "/src/worker.js"));