rollup-plugin-license-xml
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

rollup-plugin-license-xml NPM version

rollup-plugin-license-xml

Creates a license.xml file from all your dependencies see template

Install

$ npm install --save-dev rollup-plugin-license-xml

Usage

Importing or Requiring

Import as ES Module

import license from 'rollup-plugin-license-xml'

Requiring as CJS

const license = require('rollup-plugin-license-xml')

Usage from rollup config

export default {
  entry: 'module.js',
  dest: 'index.js',
  format: 'cjs',
  plugins: [license()]
}

Usage from build script

rollup({
  entry: 'main.js',
  plugins: [license()]
}).then(...)

results

logged to console on rollup completion

<other>
    <description>rollup-plugin-license-xml</description>
    <locations>
        <file>/test/_fixtures/bundle-a.js</file>
    </locations>
    <licenses>
    <license>
        <name>MIT</name>
        <url>https://raw.githubusercontent.com/edewit/rollup-plugin-license/master/LICENSE</url>
    </license>
    </licenses>
</other>
<other>
  ...

Options

  • root - optional
    • type: String
    • default: process.cwd()
    • description: Application directory, used to display file paths relatively
  • writeTo - optional
    • type: Function
    • default: null
    • description: Callback to be invoked with formatted string
    • function will be invoked with:
      • analysisString (String)
  • onAnalysis - optional
    • type: Function
    • default: null
    • description: Callback to be invoked with analysis object
    • function will be invoked with:
      • analysisObject (Object)
        • modules (Array) - array of module analysis objects
          • module (Object)
            • id (String) - path of module / rollup module id
            • files (Array) - list of files

Package Sidebar

Install

npm i rollup-plugin-license-xml

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

15.7 kB

Total Files

9

Last publish

Collaborators

  • edewit