• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
maxm

maxm

lockfileImportMap

Public
Like
2
lockfileImportMap
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Lockfile Import Map

image.png

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:

Create val
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!

Code
README.mdmain.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.