Hacker News new | ask | show | jobs
by xiphias2 1206 days ago
I thought this will be an article about adding import maps to deno, which would be great.

I hope builders start adding it (at least to dev instances) to decrease the magic.

I was trying to use import maps, but it's not trivial go create actually.

There are always problems with Node lagging behind browsers though that makes developing hard (no WebSocket support by default for example, crypto module is also not included)

1 comments

Deno does support import maps out of the box. For Node there’s a loader[1] you can use (though a glance at the GitHub issues suggests it’s incomplete).

1: https://www.npmjs.com/package/@node-loader/import-maps

Does it generate import maps for me automatically? That's the hard part.

I'm using Vite with Sveltekit, which is great because it compiles files separately, but still doesn't generate import maps, but uses imports with relative and absolute filenames.

I don’t use Svelte of any kind so I’m possibly out of my depth, but I don’t know what I’d want to automate with import maps. I don’t think Deno addresses any use case like that but I’m hesitant to say so because I really don’t know what need I’m even addressing.