How to avoid plumbing environment variables in esmodule worker

I don’t want to pass down environment variables to every tiny function, and in so far what I have is wrapping whole files in a function so that env is available in scope, and then exporting the exports as the return of that function. I now also have to change the routing library which doesn’t seem to module workers. I read the release notes on module workers, and how having explicit modules permits you to better use packages, but I would have rather had the env stuff be opt in.