JSPM

@nemoinho/greasemonkey-header-plugin

2.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q43604F
  • License MIT

This plugin provides the ability to setup a greasemonkey header on top of compiled code

Package Exports

  • @nemoinho/greasemonkey-header-plugin

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 (@nemoinho/greasemonkey-header-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GreasemonkeyHeaderPlugin

A plugin to simply add userscript-headers via webpack.

Installation

npm i --save-dev @nemoinho/greasemonkey-header-plugin

Usage

As this is a webpack-plugin you need webpack to use this script.

To enable the plugin you configure it as follows in your webpack.config.js:

const GreasemonkeyHeaderPlugin = require('@nemoinho/greasemonkey-header-plugin');
const pkg = require('./package');

module.exports = {
  entry: 'index.js',
  output: {
    filename: 'bundle.user.js',
    path: path.resolve(__dirname, 'dist')
  },
  plugins: [
    new GreasemonkeyHeaderPlugin({
        name: 'My awesome',
        author: 'Joe Dow',
        description: 'My awesome userscript',
        include: '/^https?:\\/\\/example.com\\/.*/',
        version: pkg.version,
        grant: 'none'
    })
  ]
}

The given options are all translated to user-script tags but at least name and include are necessary.