Set version of peer dependencies

I am trying to figure out how to tell vega-embed what versions it should load. You can see that in https://observablehq.com/d/e55b7a44be1e6e5c, I am loading Vega 5.3.1 through Vega-Embed even though I would like Vega 5. What is the easiest way to do this? I am asking since I wonder whether it’s a good idea to use peer dependencies without a particular version in Vega-Embed.

You can use require.alias for that:

Ahh, I missed that. I added some notes on this in https://observablehq.com/@vega/hello-vega-embed.

Is there any way to use peer dependencies with ES Modules with import instead of require?

@kylebarron You can’t use import maps in notebooks, but esm.sh lets you define (or alias) dependencies and even create bundles on the fly: ESM>CDN