Our production tree has 341 packages under 16 licence texts, and the 1.3 MB of JavaScript we serve carries one copyright line
Nobody asked me to do this. A page on our site is about music licences for pub quizzes, and I realised I had never looked at the other kind: the licences of the software we build on. So I looked, in two places: the depen
Nobody asked me to do this. A page on our site is about music licences for pub quizzes, and I realised I had never looked at the other kind: the licences of the software we build on. So I looked, in two places: the dependency tree on disk, and the JavaScript we actually send to visitors.
I am not a lawyer and this is not legal advice. It is a census, and the interesting part is the gap between the two halves.
What the tree says
pnpm licenses list --prod --json
On our storefront (33 direct production dependencies) that returns 341 packages, grouped by the licence each one declares:
| Licence | Packages |
|---|---|
| MIT | 275 |
| Apache-2.0 | 21 |
| ISC | 15 |
| BSD-2-Clause | 7 |
| BlueOak-1.0.0 | 6 |
| BSD-3-Clause | 4 |
| FSL-1.1-MIT | 2 |
| Unlicense | 2 |
| MPL-2.0 | 2 |
| LGPL-3.0-or-later | 1 |
| Six more licence texts, one package each | 6 |
That is 16 distinct licence strings for 341 packages, and 81 per cent of the tree is plain MIT. Of our own 33 direct dependencies, 29 are MIT, two are Apache-2.0 (the ORM and a class-variance helper), one is ISC (the icon set) and one is Unlicense (the Postgres driver). No surprises at the top of the tree. The surprises are all one level down.
The five worth a second look
-
LGPL-3.0-or-later, one package. It is
@img/sharp-libvips, the native image library that Next uses to resize pictures fornext/image. LGPL is the licence people worry about, and it is the only copyleft text in the tree. It runs on the server and is never sent to a browser, so the thing that matters about it is how it is linked, not what we ship. A SaaS that runs it and does not distribute it is in the easy case. - FSL-1.1-MIT, two packages. The Functional Source License. It is source-available rather than open source: use is free, but you may not use it to build a competing product for two years, after which a release converts to MIT. Both packages are the build-time CLI from our error-tracking vendor. Nothing about it reaches a visitor, and we are not competing with it, but it is the one licence in the tree that the Open Source Initiative does not list.
-
MPL-2.0, two packages.
lightningcss, which the CSS toolchain uses, in its generic and Mac builds. File-level copyleft that only bites if you modify its files. -
CC-BY-4.0, one package.
caniuse-lite, the browser-support data. Attribution-required, and a data licence rather than a software one. It is used by build tooling. -
(MPL-2.0 OR Apache-2.0),(MIT AND Zlib),(MIT OR CC0-1.0). Three expressions rather than names: you pick one, or in the Zlib case you comply with both. Any tool that matches on the stringMITwill misread them.
Two caveats on the census. It was run on a Mac, so the platform binaries are the darwin ones, and I am assuming the Linux builds that Vercel uses carry the same licence families. And pnpm licenses reads what each package declares; it does not check that the declaration is true.
What actually reaches a browser
Most of those 341 packages never leave the build machine or the server. The ones that matter for notices are the ones whose code is inside the JavaScript files a visitor downloads. That is a different list, and you can measure it yourself:
curl -s https://pub-trivia.app/ \
| grep -o '/_next/static/[^"\\ ]*\.js' | sort -u \
| while read u; do curl -s --compressed "https://pub-trivia.app$u"; done \
> home.js
wc -c home.js
grep -c '@license' home.js
grep -o 'copyright:"[^"]*"' home.js
On our homepage that is 24 JavaScript files and 1,267,515 bytes uncompressed. Across twelve pages (the homepage, pricing, FAQ, features hub, a guide, two tools, the questions hub, compare, login, signup and about) the union is 30 files and 1,330,315 bytes. In all of it:
-
@licenseappears 0 times. - A
/*!banner, the other convention for comments a minifier is told to keep, appears 0 times. - The word copyright appears in a licence-bearing way once:
copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)". That is a core-js polyfill registry, carrying a licence URL, version string 3.38.1.
That one is also a clue about where it came from. Our lockfile has core-js at 3.51.0, so the 3.38.1 in the bundle is not a copy we installed. It is the framework's own vendored polyfill.
So we ship React, a UI toolkit, an icon set, an animation library and a PDF writer to every visitor, all MIT or ISC, and the only attribution in the whole payload belongs to a library we did not choose. The minifier removes comments, and these licences (MIT, ISC) ask for their notice to be kept with copies of the software. Whether sending minified JS to a browser counts as the sort of copying that clause means is a question for someone qualified. The practical observation does not need a lawyer: if it did count, we would not be meeting it.
The signatures I found in the bundle, for scale: React's error decoder in 3 files, Radix primitives in 5, the PDF library in 1 (only on the pages that build a PDF), the icon set in 1, and the animation library in 2. Several that sit in our dependency list, Stripe's SDK and the Supabase client, are in none of them, which is correct: they are server code, and the server is not distributed.
The cheap fix, and why I have not applied it
The straightforward remedy is a notices page generated from the same pnpm licenses output, listing each package that can reach the browser with its licence text. It is a script and a route, and a build step that fails when the page is older than the lockfile. I have not written it for this post, because the post is the census and I would rather report what I found than hide it behind a change.
What I will not do is claim the opposite. We do not currently publish a licences page. A request for /licenses on the live site redirects to the sign-in page, which tells you it is not a route.
What to copy
-
Run
pnpm licenses list --prod --jsononce. It takes a few seconds, and 341 packages is a number nobody guesses. -
Read the expressions, not the first word.
(MIT AND Zlib)and(MPL-2.0 OR Apache-2.0)are policy decisions in disguise. - Separate the tree from the payload. A licence that matters to a server is rarely the licence that matters to a browser. Measure the bundle separately.
-
Count notices with a command you can paste. The
grepabove works on any site, and the answer for most of them will surprise you.
If you want a look at the music kind of licence, our guide on it is here. If you would rather see the product behind all this JavaScript, the homepage has the free tier, which needs no card.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.