Importing a frontend Javascript library without a build system
Simon Willison’s Weblog
Subscribe
Sponsored by: Atlassian — Give your agents a plan. Not a prompt. New Jira capabilities unlock full-context for AI-native software development. Assign tasks to Claude, Cursor, or GitHub Copilot, now directly from Jira. Learn more
23rd November 2024 - Link Blog
Importing a frontend Javascript library without a build system . I sometimes think the hardest problem in computer science right now is taking an NPM library and figuring out how to download it and use it from a tag without needing to involve some sort of convoluted build system.
Julia Evans shares my preference for build-free JavaScript, and has shared notes about figuring out how to turn an arbitrary NPM package into something that can be loaded in a browser.
It's so complicated! This is the best exploration I've seen yet of the topic but wow, this really needs to be easier.
My download-esm tool gets a mention, but I have to admit I'm not 100% confident in that as a robust solution. I don't know nearly enough about the full scope of the problem here to confidently recommend my own tool!
Right now my ideal solution would turn almost anything from NPM into an ES module that I can self-host and then load using import ... from in a block, maybe with an importmap as long as I don't have to think too hard about what to put in it.
I'm intrigued by esm.sh (mentioned by Julia as a new solution worth exploring). The length of the documentation on that page further reinforces quite how much there is that I need to understand here.
Posted 23rd November 2024 at 7:18 pm
Recent articles
OpenAI’s accidental cyberattack against Hugging Face is science fiction that happened - 22nd July 2026
A Fireside Chat with Cat and Thariq from the Claude Code team - 21st July 2026
Kimi K3, and what we can still learn from the pelican benchmark - 16th July 2026
This is a link post by Simon Willison, posted on 23rd November 2024.
javascript<br>760
npm<br>23
julia-evans<br>30
Monthly briefing
Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.
Pay me to send you less!
Sponsor & subscribe
Disclosures
Colophon
©
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026