Using webassembly with web workers and CDN

I’d like to use a webassembly module in a web worker. There are three files in the game: library.wasm, library.js and library-worker.js. Everything works fine if all of these are hosted on the same server with a worker code like this:

importScripts ('library.js');

onmessage = async function (ev)
{
    let lib = await library ();
    // do some cool stuff
};

My problem happens when I try to use a version of the library that is hosted in another server, something like this:

importScripts ('https://cdn.jsdelivr.net/npm/[email protected]/dist/library.js');

onmessage = async function (ev)
{
    let lib = await library ();
    // do some cool stuff
};

The main js file is loaded successfully, but it still looks for the library.wasm file locally. Is there any way to make it load the wasm file from the same cdn as the js file?