2.0.2 • Published 5 years ago

@nemoinho/greasemonkey-header-plugin v2.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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.