Self-Study Unit: Shipping Third-Party Licence Notices
Most permissive licences ask for very little, but the little they ask is easy to lose. If your package bundles, vendors or minifies code written by someone else, you are usually redistributing it, and its licence notice has to travel with it. This unit explains when that applies, what a tidy notice file looks like, and how build tools quietly break it. It is educational material for maintainers, not legal advice.
Objectives
- Tell the difference between declaring a dependency and redistributing it.
- Identify which common licences require you to keep notices.
- Produce a third-party notices file for a package.
- Check that a build step has not removed required text.
Explanation
Declared versus bundled
When your package.json or pyproject.toml merely lists a dependency, the user's package manager fetches that dependency from its own source, complete with its own licence file. You are not redistributing it. When you copy the code into your repository, or a bundler inlines it into your dist/ output, or you ship a wheel with a compiled library inside, you are. Those copies are the ones that need notices.
What the common licences ask
| Licence | Notice requirement in short |
|---|---|
| MIT | Include the copyright notice and permission notice in copies or substantial portions. |
| BSD-2-Clause / BSD-3-Clause | Retain the copyright notice, conditions and disclaimer; for binaries, reproduce them in documentation or other materials. |
| ISC | Similar to MIT: keep the copyright and permission notice. |
| Apache-2.0 | Provide a copy of the licence, keep notices, mark modified files, and pass on any NOTICE file the upstream includes. |
Read the full text of each licence on the SPDX License List or the Open Source Initiative site before relying on a summary like this one.
A tidy notices file
THIRD-PARTY NOTICES for package-g
This package includes code from the following projects.
------------------------------------------------------------
tiny-parser 1.4.0 (MIT)
Location in this package: dist/vendor/tiny-parser.js
Copyright (c) [year] [original author]
Permission is hereby granted, free of charge, ...
[full MIT text as it appears upstream]
------------------------------------------------------------
Copy the upstream notice exactly, including the original copyright line. Do not "normalise" years or names.
How bundlers lose notices
Minifiers strip comments by default, and the licence header at the top of a vendored file is a comment. Many minifiers keep comments that start with /*! or contain @license, and many bundlers can extract licence comments to a separate file. Whatever your tool, configure it deliberately and check the output rather than assuming.
Practice exercise
Using your own package, or a hypothetical Package G that bundles two small MIT libraries and one Apache-2.0 library with a NOTICE file:
- Run
npm pack --dry-run(or build a wheel and list its contents) and note which third-party code physically ends up in the artefact. - For each item, find its licence and any NOTICE file upstream.
- Write a
THIRD-PARTY-NOTICESfile and add it to the published files list. - Grep the minified output for each library's licence header.
Self-check answers
- Do I need notices for runtime dependencies that are not bundled? Generally no; those are installed from their own source with their own files.
- Where does an upstream Apache-2.0 NOTICE go? Its attribution content must be passed on, typically by including it in your own NOTICE or notices file.
- Is a link to the upstream repository enough? Not for MIT, BSD or Apache-2.0, which ask for the text itself to accompany copies.
- Should my SPDX expression change? If your published package now contains code under another licence, an expression such as
MIT AND Apache-2.0describes it more accurately.
The licence compatibility FAQ covers what happens when the licences involved are not permissive.