You can use Shimport in web workers via importScripts. This is the code inside worker.js — you can see the output by opening the console.
importScripts('../shimport.js');
__shimport__.load('./app/main.js', location.href);
import { foo } from './foo.js';
console.log(foo);
import('./bar.js').then(({ bar }) => {
console.log(bar);
});
export const foo = `hello from ${location.origin}/web-worker/app/foo.js!`;
export const bar = `hello from ${location.origin}/web-worker/app/bar.js!`;