@city-of-helsinki/license-notices weekly downloads statistics
By city-of-helsinki · npm · Webpack plugins
Third-party license notices for the production build of a Vite, Next.js, webpack or Rsbuild application
@city-of-helsinki/license-notices has 412 recorded weekly downloads on npm, ranking #1636 of 2,687 tracked listings.
About @city-of-helsinki/license-notices
@city-of-helsinki/license-notices
Writes the license notices of every third-party package bundled into the production build of a Vite, Next.js, webpack or Rsbuild application, and serves them from the root of the deployed application.
Why
Serving an application to a browser distributes its JavaScript bundle, and with it every open source package the bundle contains. Almost every open source license attaches conditions to that distribution:
- MIT, ISC, BSD and Apache-2.0 require the copyright notice and the license text to travel with the code.
- MPL-2.0 (section 3.2) also requires telling recipients where the source of the MPL-covered files can be obtained.
- GPL-2.0 requires a copy of the license (section 1) and access to the complete corresponding source (section 3).
A minified bundle carries none of this: minification strips the license
comments, and the license files stay behind in node_modules. This package
collects them at build time from exactly the packages that ended up in the
bundle, and writes them next to it:
third-party-licenses.txt, the notices for people to read, andoss-licenses.json, the same data for license audit tooling.
Both are generated on every build, so they always describe the build they ship with. Neither is committed to the repository.
It prefers failing the build to shipping something nobody has checked: a license it cannot identify, a license decision that no longer matches the package, or a copyleft license it has no notice rules for all stop the build with a message that says what to check. See When the build fails.
Setup
-
Add the package:
pnpm add --save-dev @city-of-helsinki/license-notices -
Put everything specific to the repository in a config file of its own. For Vite, for example
scripts/thirdPartyLicenses.config.ts:import type { ThirdPartyLicensesConfig } from '@city-of-helsinki/license-notices'; export const thirdPartyLicensesConfig: ThirdPartyLicensesConfig = { repositoryUrl: 'https://github.com/City-of-Helsinki/<repository>', };For Rsbuild, the same file, with the type imported from
@city-of-helsinki/license-notices/rsbuild.A CommonJS
next.config.jscannot load a TypeScript file, so for Next, for examplescripts/thirdPartyLicenses.config.js, typed with JSDoc:/** @type {import('@city-of-helsinki/license-notices/next').ThirdPartyLicensesConfig} */ const thirdPartyLicensesConfig = { repositoryUrl: 'https://github.com/City-of-Helsinki/<repository>', }; module.exports = { thirdPartyLicensesConfig }; -
Make sure the application's own
LICENSEfile is present when the build runs, because the notices start with the application's own license. In a Docker build, do not exclude it in.dockerignore, and if.dockerignorelists the files to include instead, add!LICENSE. A Dockerfile that copies the files it needs one by one has to name it as well:COPY --chown=default:root index.html LICENSE vite.config.ts ./One that copies the whole build context, with
COPY . ., needs nothing more. -
Run
pnpm buildand read the output. The first build of an existing application usually needs a license decision or two; the build tells which. -
Consider a test for the license decisions in the config, since a reader cannot verify them from the bundle:
it('elects Apache-2.0 for the dual-licensed dompurify', () => { expect(thirdPartyLicensesConfig.licenseDecisions?.dompurify?.license).toBe( 'Apache-2.0' ); });
Vite
Add the plugin to vite.config.ts:
import { thirdPartyLicenses } from '@city-of-helsinki/license-notices';
import { thirdPartyLicensesConfig } from './scripts/thirdPartyLicenses.config';
export default defineConfig({
plugins: [
// ...
thirdPartyLicenses(thirdPartyLicensesConfig),
],
});
The plugin only runs in vite build, and emits both files into the build
output.
Next.js
Wrap the Next config with withThirdPartyLicenses, from the
@city-of-helsinki/license-notices/next entry point, and enable production
source maps, which the notices are read from:
const {
withThirdPartyLicenses,
} = require('@city-of-helsinki/license-notices/next');
const {
thirdPartyLicensesConfig,
} = require('./scripts/thirdPartyLicenses.config');
module.exports = {
// ...
productionBrowserSourceMaps: true,
};
module.exports = withThirdPartyLicenses(
module.exports,
thirdPartyLicensesConfig
);
module.exports = withSentryConfig(module.exports, {
// ...
});
-
The notices are written during
next build, after the client is compiled, into thepublicdirectory.next startserves them from there, and so does the server of anoutput: 'standalone'build, oncepublicis copied next to it as Next's deployment instructions say. Add both files to.gitignore:/public/third-party-licenses.txt /public/oss-licenses.jsonEach build replaces the files it writes, but leaves a file it no longer writes in place, after
manifestFileNameis set tofalseor a file name is changed. Remove such a file by hand.…
Description from the npm listing.
- vite-plugin
- nextjs
- webpack-plugin
- rsbuild-plugin
- license
- third-party-notices
- open-source-compliance
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (2)Similar npm Webpack plugins plugins
All 20 @city-of-helsinki/license-notices alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@city-of-helsinki/license-notices. First seen Oct 29, 2026; last successful collection Oct 30, 2026. See the methodology.