Public
maxm
lockfileImportMap
Script
Lockfile Import Map Use an import map to make sure your Val frontend and backend are always using the exact same versions. We already track the versions of your https imports in the Deno lockfile. Now you can expose those on the frontend as well using an import map. Use it like so: import { lockfileImportMap } from "https://esm.town/v/maxm/lockfileImportMap"
return new Response(`
<script type="importmap">${lockfileImportMap()}</script>
<script type="module" src="${import.meta.url}"></script>
`, { headers: {"content-type": "text/html"}}); Here's an example app I made with townie: https://www.val.town/v/maxm/emojiTodoListApp You can see that the "https://esm.sh/react" import imports the version directly without any redirects. Saving on network hops and also ensuring version stability!
0
maxm-emojitodolistapp.web.val.run
Updated: January 24, 2025