blob: b43f8cb1f6869e1a42cc71a82a876d78f78548b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
// This time ./worker.ts is not in the module map, so the worker
// initialization will fail unless worker.js is passed as a side module.
const worker = new Worker(
new URL("./worker.ts", import.meta.url),
{ type: "module" },
);
setTimeout(() => {
worker.postMessage(42);
}, 500);
|