---
title: "Vendoring"
description: "Vendoring, copying a dependency's source directly into your repository, gives full dependency visibility, debuggability, auditable code and builds that don't resolve packages at deploy time."
url: "https://swe.quest/articles/vendoring-601ecb035f28a83c"
canonical: "https://htmx.org/essays/vendoring/"
source: "htmx essays"
published: "2025-01-27"
difficulty: "easy"
kind: "Opinion"
reading_minutes: 7
tags: ["supply-chain-security","build-systems","javascript","open-source"]
---

# Vendoring

A post on [htmx essays](https://swe.quest/sources/htmx.md), published 2025-01-27, 7 min read, Opinion. Original: [https://htmx.org/essays/vendoring/](https://htmx.org/essays/vendoring/)

## Summary

Vendoring, copying a dependency's source directly into your repository, gives full dependency visibility, debuggability, auditable code and builds that don't resolve packages at deploy time. Its real weakness is the transitive dependency problem, but that friction usefully discourages large dependency graphs. htmx shows the cost of the alternative: 16 declared npm dev dependencies balloon to 411 packages and a 110 MB node\_modules, including an unwanted polyfill that threatens IE compatibility. The essay argues for fewer dependencies, vendor-friendly zero-dependency libraries, and vendor-first dependency managers that handle transitive deps, updates and local modifications.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- package managers like npm ([easy posts on Build systems](https://swe.quest/tags/build-systems.md?difficulty=easy))

## Keywords

htmx, npm, vendoring, package-lock.json, left-pad, DaisyUI, fixi

## Related posts

- [Dependency prefixes are a supply chain risk: let's fix them](https://swe.quest/articles/dependency-prefixes-are-a-supply-chain-risk-let-s-fix-them-9228bb37d2c90199.md): Sourcegraph · 2026-05-22 · Medium · 5 min read · Supply chain security, JavaScript, Build systems, Refactoring & migrations
  SemVer range prefixes like ^, ~ and wildcards in package.json act as a trust policy that lets compromised or hijacked packages flow into CI and production on the next install.
- [If you're not using npm specifiers, you're doing it wrong](https://swe.quest/articles/if-you-re-not-using-npm-specifiers-you-re-doing-it-wrong-1ef0f76947ddfda3.md): Deno · 2025-02-13 · Medium · 7 min read · JavaScript, TypeScript, Build systems, Supply chain security
  Deno now recommends importing npm packages with native \`npm:\` specifiers instead of HTTP transpile services like esm.sh or unpkg.
- [Bun v1.2.14](https://swe.quest/articles/bun-v1-2-14-0a4154959c4f5eb6.md): Bun · 2025-05-21 · Medium · 4 min read · JavaScript, Runtimes & VMs, Build systems, TypeScript
  Bun v1.2.14 adds dependency catalogs to \`bun install\`, letting monorepos define shared versions once in the root package.json and reference them with the \`catalog:\` protocol, which is rewritten to concrete versions on publish.
- [Why We Added package.json Support to Deno](https://swe.quest/articles/why-we-added-package-json-support-to-deno-0e46f636e0588f6e.md): Deno · 2023-03-20 · Easy · 6 min read · JavaScript, Build systems, Runtimes & VMs
  Deno added package.json support because its HTTP-import module system, though decentralized and manifest-free, suffers from the Duplicate Dependency Problem, the clunky deps.ts pattern, non-composable import maps, and the limits of transpile servers like esm.sh.
- [The Bun Bundler](https://swe.quest/articles/the-bun-bundler-1ad40102ca8fa3b8.md): Bun · 2023-05-16 · Medium · 10 min read · JavaScript, Build systems, Developer tools, Web performance
  Bun now ships a native bundler in beta, exposed as the \`bun build\` CLI and the \`Bun.build()\` JavaScript API.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
