Note: #672 will make this significantly easier to accomplish
Currently, the generated import map does not respect the path of the page, and assumes that everything is as /. The import map should be adjusted to be relative to the current document. Once #672 lands, this should be pretty straightforward, something like:
Object.fromEntries(Object.entries(importMap).map(([k, v]) => [k, href(v, path)]))