Registry / devops / vite-plugin-license

vite-plugin-license

JSON →
library0.0.2jsnpmunverified

Vite plugin to add license banners to bundled output. Current stable version is 0.0.2 (November 2025), released on a cadence of roughly every 7 months. It is a thin wrapper around rollup-plugin-license that resolves compatibility issues with Vite's build pipeline. Key differentiators: seamless integration with Vite's configuration and plugin system; supports customizable banner comment style and content from file or inline; includes TypeScript type definitions. Compared to using rollup-plugin-license directly, this plugin handles Vite-specific nuances such as virtual module IDs and hooks.

npm install vite-plugin-license
INSTALL
IMPORT
SIG · VITE-PLUGIN-LICENS
V
vite-plugin-license
devopsjavascriptv0.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import license from 'vite-plugin-license'
import { license } from 'vite-plugin-license'
The default export is a function; named export does not exist.
LicenseOptions
import type { LicenseOptions } from 'vite-plugin-license'
Type import is needed when using TypeScript for the plugin options.
VitePluginLicense
import type { VitePluginLicense } from 'vite-plugin-license'
Type import for the plugin instance type, rarely needed directly.

Creates a Vite config with license plugin that adds a banner from LICENCE file.

import path from 'node:path'; import { defineConfig } from 'vite'; import license from 'vite-plugin-license'; export default defineConfig({ plugins: [ license({ banner: { commentStyle: 'regular', content: { file: path.join(__dirname, 'LICENSE'), }, }, }), ], });
Debug
Known issues
breakingPeer dependency requirement: vite ^7.1.12. This plugin will not work with older Vite versions.
fix
Upgrade vite to ^7.1.12 or later.
affects: >=0.0.1
deprecatedIf you previously used rollup-plugin-license directly in Vite, that approach may have issues with virtual modules; this plugin is the recommended replacement.
fix
Replace rollup-plugin-license with vite-plugin-license.
affects: >=0.0.1
gotchaThe default import is not a named export. Using 'import { license }' will result in undefined.
fix
Use 'import license from 'vite-plugin-license''.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'vite-plugin-license' or its corresponding type declarations.
TypeScript cannot resolve the module because types are not installed or package is missing.
fix
Run 'npm install vite-plugin-license' and ensure tsconfig includes 'moduleResolution': 'node' or 'bundler'.
TypeError: license is not a function
Using a named import instead of default import.
fix
Change to 'import license from 'vite-plugin-license''.
Error: The plugin 'vite-plugin-license' requires peer vite@^7.1.12 but you have an older version.
Installed Vite version does not satisfy peer dependency.
fix
Upgrade Vite: 'npm install vite@^7.1.12'.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
viterequiredPeer dependency required for Vite plugin integration; version ^7.1.12 required.
Agent activity
2 hits · last 30 days
node
2
Resources
vite-plugin-license — npm install vite-plugin-license · libregistry