Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/violentmonkey/rollup-plugin-userscript
Rollup plugin for userscript
https://github.com/violentmonkey/rollup-plugin-userscript
Last synced: 2 months ago
JSON representation
Rollup plugin for userscript
- Host: GitHub
- URL: https://github.com/violentmonkey/rollup-plugin-userscript
- Owner: violentmonkey
- License: mit
- Created: 2021-03-24T14:39:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-30T06:41:55.000Z (5 months ago)
- Last Synced: 2024-10-30T08:30:48.478Z (3 months ago)
- Language: TypeScript
- Size: 226 KB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rollup-plugin-userscript
![NPM](https://img.shields.io/npm/v/rollup-plugin-userscript.svg)
![License](https://img.shields.io/npm/l/rollup-plugin-userscript.svg)
![Downloads](https://img.shields.io/npm/dt/rollup-plugin-userscript.svg)Automatically parse metadata and set `@grant`s.
With this plugin, `@grant`s for [`GM_*` functions](https://violentmonkey.github.io/api/metadata-block/) will be added at compile time.
## Usage
Add the plugin to rollup.config.js:
```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:
```js
import './meta.js?userscript-metadata';
```