跳过导航
🔥 JavaScript import maps are now in all the browsers! Here is how they work with ES modules.
0:00 / 0:51

🔥 JavaScript import maps are now in all the browsers! Here is how they work with ES modules.

Wes Bos

@wesbos44万 位关注者

在 X 上查看
1,164 个赞下载原帖

129,827 次观看

🔥 JavaScript import maps are now in all the browsers! Here is how they work with ES modules.

10 条评论

评论来自 X (Twitter) 上的原帖

  • Wes Bos 的头像

    @wesbos

    Node.js also supports something very similar to import maps. It must be prefixed with '#' and can be used as a wildcard. There is talk + experiments around supporting the full spec via Node.js Policies Deno supports the importmap spec

    26 个赞

  • Wes Bos 的头像

    @wesbos

    TypeScript has `path` where you can do something very similar as well, but needs some work from your bundler to work. Maybe once we see Node.js pick up import maps, the TS paths can be replaced with import maps. Web standards?

    11 个赞

  • Jake 的头像

    @__jake__jake

    I wonder how the dependency conflicts would be solved in this context 🤔. Or is this just another way of importing a library like a regular script src tag?

    1 个赞

  • Wes Bos 的头像

    @wesbos

    It only resolves them 1 level deep, so your dependencies would have to resolve themselves or have their own import map. So i'd expect the same issues that we have with npm

    4 个赞

  • Mihemed Şahîn 的头像

    @mihemedshahin

    🔥 So excited to try it.

    1 个赞

  • Joaquin Beceiro 的头像

    @juacobeceiro

    Excellent for testing avoiding installing modules for a simple test application! Thank you!!

    1 个赞

  • Url Sweatshirt 的头像

    @AbdulIsBomb

    Was not prepared for the safari dev tools jump scare at the end

    1 个赞

  • Joshua Koudys 的头像

    @jkoudys

    Good for those of us who don't need to transpile any JSX.

  • k644 的头像

    @k64411

    Cool!

  • 35961 的头像

    @359_6_1

    #JavaScript Is boxing about putting two people in a box? In JavaScript, Boxing is the automatic conversion of strings to objects when methods are called on them.