Nudeps by Lea Verou: Using npm Packages in the Browser Without a Bundler or ConfigArticle · digest for November 19
Nudeps by Lea Verou: Using npm Packages in the Browser Without a Bundler or Config
Article5 sections≈ 7 min

Nudeps by Lea Verou: Using npm Packages in the Browser Without a Bundler or Config

It's a familiar fork in the road. You're building a small site or demo in plain HTML and JS, and you want Vue, D3, or a tooltip library. Usually you get two annoying options. Either download files by hand, wire up external CDNs, and forget npm install, or set up a bundler like Vite or Webpack just for one line: import { createApp } from "vue".

Browsers don't understand that line on their own. Writing "vue" without a URL or path is a bare specifier. Browsers need a real URL, and node_modules/ was never designed to be deployed to a web server. So even tiny projects end up pulling in a bundler—along with config files, background processes, and build layers that break working browser code. In the State of JS 2025 survey, dependency management ranked 3rd among JS developers' biggest pain points, and build tools ranked 6th.

On November 18, 2026, Lea Verou announced Nudeps on her blog, released under MIT (v0.4.4, 133.8 KB). She built the first prototype in February with her student Dmitry Sharabin, tested it with beta users, and consulted Jordan Harband. The name plays on nude deps (bare dependencies without bundler wrapping) and sounds like new deps.

The idea isn't to abolish bundlers altogether, but to offer a light-build middle ground. Bundlers still handle heavy compilation and optimization, while Nudeps covers simple projects without touching your own code at all.

Two Commands Instead of Configs: How It Works With No Background Process

Once installed, you can forget Nudeps is even there. It doesn't run in the background, watch your files, or rewrite your JS. In a folder with package.json, one command does the job:

# Installs nudeps, adds hooks, and builds the initial import map
npx nudeps install

It adds nudeps to devDependencies, runs the first build, and writes two scripts into package.json. The trick relies on npm's built-in dependencies hook—a feature many developers don't even know exists—which runs automatically after every npm install and npm uninstall. Meanwhile, prepare sets things up after a fresh git clone.

{
  "scripts": {
    "dependencies": "npx nudeps",
    "prepare": "npx nudeps"
  },
  "devDependencies": {
    "nudeps": "^0.4.4"
  },
  "dependencies": {
    "jquery": "^4.0.0",
    "jquery1": "npm:jquery@^1.12.4"
  }
}

That's the actual package.json from the jQuery demo, running two versions side by side via an npm alias. No watcher stays open in your terminal. Developers are so used to fiddling with configs that early testers were thrown off by the silence. Sam Littlefair said he ran npx, added the import map, and braced for a pile of extra steps—only to realize he was already done.

You still need a local HTTP server for ES modules because browsers block them over file://. As Lea jokes, though, a local server costs nothing: your editor or agent can start one, and she keeps a single server running at the root of her repos folder.

Under the Hood: client_modules, JSPM, and a Smart importmap.js

Under the hood, Nudeps stitches together proven pieces. The first is Import Maps, the browser's built-in <script type="importmap"> dictionary that maps "vue" to a real file path. It's already Baseline Widely Available, meaning it works reliably across all major modern browsers.

The second is the JSPM engine (@jspm/generator and @jspm/overrides), usually paired with CDNs, running locally here. On every npm install, Nudeps copies the needed files from node_modules/ into a flat client_modules/ folder with versions in directory names, like client_modules/vue@3.5.45/. Duplicates vanish, and browser caching busts per package: update one dependency and the rest stay cached. Both client_modules/ and .nudeps/ get their own .gitignore so Git stays clean, while client_modules/ deploys to production.

Browsers still require <script type="importmap"> inline in every HTML page. Nudeps sidesteps that with a /importmap.js script that injects the tag on the fly:

<!-- Classic script without type="module", placed before any modules -->
<script src="/importmap.js"></script>
<script type="module">
  // Bare specifier works directly in the browser
  import { createApp } from "vue";
</script>

The real importmap.js from the Vue demo shows nice attention to detail. It resolves relative paths against document.currentScript.src using new URL(), so one file works across nested pages. It also throws if you accidentally add type="module" and warns in the console if placed after a module script. Before production, prune strips unused imports; during development, the map keeps all entry points so you don't rebuild every time you add an import in your code.

What Already Works: From Vue and Dual jQuery to CSS and lodash

nudeps.dev itself already runs on nudeps@0.4.4. Live bundler-free demos cover Vue (Lea's favorite), Lit, D3, gsap, Three.js, Floating UI, interact.js, Underscore, and even React (though writing React without JSX isn't much fun). Dynamic import(), import.meta.resolve(), local packages (npm i ../foo), git dependencies, aliases, and experimental workspaces all work.

Module formats split cleanly. Modern ESM packages (import/export) run natively in browsers without friction. Older CommonJS libraries like lodash expect Node's require(), so Nudeps includes an experimental cjs-browser-shim layer where you import { require } from "cjs-browser-shim" and call require("lodash").

CSS libraries and icon packs like Open Props or Bootstrap Icons work differently because browsers can't import stylesheets by bare name yet—they need a URL. To keep your HTML links from breaking on every version bump, Nudeps creates unversioned symlinks in client_modules/ (or redirects on hosts without symlink support):

<!-- Symlinked path stays stable when the package updates -->
<link
  rel="stylesheet"
  href="client_modules/open-props/open-props.min.css"
/>

That's how the Open Props demo loads its styles. There's one catch: external CSS dependencies won't auto-resolve unless bundled inside, though almost all style and icon libraries are self-contained.

How Nudeps Made Claude Argue With npm—and Why SKILL.md Fixed It

AI agents provided an unexpected comedy moment. Since February's tests, Claude generally handled Nudeps fine, but kept doing busywork out of habit: adding client_modules/ to .gitignore even though the folder ignores itself, inventing npm run build, and running npx nudeps by hand. It even ran npm run dependencies manually, assuming it was a custom script.

The funniest part? Claude didn't know npm has a built-in dependencies lifecycle hook and, according to Lea, confidently argued that it didn't exist. A SKILL.md file in the Nudeps repo fixed everything with a table of common agent mistakes (don't touch client_modules/, don't put type="module" on importmap.js, don't run npx nudeps manually). Installing it via npx skills add nudeps/nudeps in Claude Code, Cursor, or Copilot stops the extra edits.

Where Nudeps Stops and You Still Want a Bundler

Nudeps is honest about its limits. It never compiles your code, so TypeScript, JSX, Svelte, and Vue single-file components (.vue) still need a compiler (though Nudeps pairs fine with static site generators or tsc). Right now it only supports npm—pnpm and yarn are top priorities, not in 0.4.4 yet.

The web platform has limits too. Import maps still don't work in Web Workers; issue whatwg/html#8173, opened by Guy Bedford in August 2022, remains open. Some packages also expect Node APIs like process.env. Nudeps stubs basic cases, while trickier ones are easier to override with a browser bundle in nudeps.js.

Finally, there's cold-load speed. Without bundling, a package split into dozens of small ESM files triggers a waterfall of requests. There are no benchmarks against Vite, esbuild, or Webpack yet, and Lea notes openly that depending on package structure, a bundler can be noticeably faster—or occasionally a bit slower.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 9