JSPM

rollup-plugin-userscript-header

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q30809F
  • License MIT

Rollup plugin for generating userscript headers

Package Exports

  • rollup-plugin-userscript-header

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rollup-plugin-userscript-header) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rollup-plugin-userscript-header

A Rollup plugin to add userscript metadata blocks to files.

Install

Using npm:

npm install rollup-plugin-userscript-header --save-dev

Usage

Create a rollup.config.js configuration file and import the plugin:

import userscriptHeader from 'rollup-plugin-userscript-header';

export default {
    input: 'src/index.js',
    output: {
        dir: 'output',
        format: 'cjs'
    },
    plugins: [userscriptHeader()]
}

Then call rollup either via the CLI or the API.

The metadata block will be filled in with the default fields found in project.json.

Options

cwd

Type: String
Default: process.cwd()

Sets the directory of the package.json which is used for default values.

overwrite

Type: Object
Default: null

Values which will overwrite the default metablock.

userscriptHeader({
    overwrite: {
        name: 'New Name',
        match: [
            'http://somedomainname.com',
            'http://anotherdomainname.com'
        ]
    }
})

License

LICENSE (MIT)