Registry / devops / rollup-plugin-oss

rollup-plugin-oss

JSON →
library0.4.0jsnpmunverified

Rollup plugin (v0.4.0) that generates a disclosure.json file listing all bundled dependencies with their licenses, and optionally zips source files grouped by package. Works with rollup ≥1.0, vite ≥4.0, and rolldown ≥1.0.0-beta.0. Parses SPDX license expressions, aborts on ambiguous "or" licenses, and uses SPDX license texts. Similar to license-checker-webpack-plugin. Stable release cadence, TypeScript types included.

npm install rollup-plugin-oss
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-OSS
R
rollup-plugin-oss
devopsjavascriptv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default (LicensePlugin)
import LicensePlugin from 'rollup-plugin-oss'
const LicensePlugin = require('rollup-plugin-oss')
Package is ESM-only; dynamic import() or import statement required.
LicensePlugin
import LicensePlugin from 'rollup-plugin-oss'
import { LicensePlugin } from 'rollup-plugin-oss'
This package has only a default export, not named.
type LicenseOptions
import type { LicenseOptions } from 'rollup-plugin-oss'
import { LicenseOptions } from 'rollup-plugin-oss'
TypeScript interface for plugin options; value import will fail at runtime.

Minimal rollup config using rollup-plugin-oss with extra dependencies and filtering.

import LicensePlugin from 'rollup-plugin-oss'; export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' }, plugins: [ LicensePlugin({ extra: [{ author: 'Example Author', description: 'Manual dependency entry', license: 'MIT', name: 'manual-pkg', repository: 'https://github.com/example/manual-pkg', version: '1.0.0' }], filter: /@mycompany\/.*/, jsonFilename: 'disclosure.json', zipFilename: 'src.zip' }) ] };
Debug
Known issues
gotchaCircular dependencies in bundled packages can cause issues. The README references a known issue with readable-stream.
fix
Ensure no circular dependency chains among bundled packages; see https://github.com/nodejs/readable-stream/issues/348
affects: >=0.0.0
gotchaLicense parsing aborts if an SPDX expression with 'OR' operator is encountered (ambiguous license).
fix
Manually specify the license using the 'extra' option or override the package's license field.
affects: >=0.0.0
gotchaThe plugin only works with ESM import; CommonJS require() will fail.
fix
Use import statement or dynamic import() in an ESM context.
affects: >=0.4.0
deprecatedThe 'filter' option using RegExp may be deprecated in future versions in favor of function filters.
fix
Use a function as filter for better flexibility.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'rollup-plugin-oss'
Package not installed or ESM-only; require() used in CJS context.
fix
npm install -D rollup-plugin-oss && use import syntax in an ESM module.
TypeError: LicensePlugin is not a function
Default import used as named import: import { LicensePlugin } from 'rollup-plugin-oss'.
fix
Use default import: import LicensePlugin from 'rollup-plugin-oss'.
Error: Aborting due to ambiguous license expression (license contains 'OR')
A dependency's license field uses 'OR' operator which is not supported.
fix
Add an 'extra' entry for that dependency with a resolved license, or update the package's license.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-oss — npm install rollup-plugin-oss · libregistry