kphrx / rollup-plugin-userscript

Rollup plugin for userscript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rollup-plugin-userscript

NPM License Downloads

Automatically parse metadata and set @grants.

With this plugin, @grants for GM_* functions will be added at compile time.

Usage

Add the plugin to rollup.config.js:

import userscript from 'rollup-plugin-userscript';

const plugins = [
  // ...
  userscript(meta => meta.replace('process.env.AUTHOR', pkg.author)),
];

Import the metadata file with a suffix ?userscript-metadata in your script:

import './meta.js?userscript-metadata';

About

Rollup plugin for userscript

License:MIT License


Languages

Language:TypeScript 79.0%Language:JavaScript 20.0%Language:Shell 1.0%