Web workers
A Web Worker script can be directly imported by appending ?worker
to the import request. The default export will be a worker constructor:
import Worker from "./my-worker?worker";
const myWorker = new Worker();
Using this method the worker script can use import
instead of importScripts.