Instead of calling importScripts, which is prone to relative path issues, generate the worker script with everything it needs included.