Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flandredaisuki/rollup-plugin-userscript-metablock
Transform json file to userscript metablock and append on.
https://github.com/flandredaisuki/rollup-plugin-userscript-metablock
hacktoberfest rollup rollup-plugin userscript
Last synced: 25 days ago
JSON representation
Transform json file to userscript metablock and append on.
- Host: GitHub
- URL: https://github.com/flandredaisuki/rollup-plugin-userscript-metablock
- Owner: FlandreDaisuki
- License: mit
- Created: 2017-11-10T16:54:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-03T13:05:00.000Z (5 months ago)
- Last Synced: 2024-10-11T11:43:18.884Z (25 days ago)
- Topics: hacktoberfest, rollup, rollup-plugin, userscript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/rollup-plugin-userscript-metablock
- Size: 315 KB
- Stars: 35
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# rollup-plugin-userscript-metablock
Transform json file to userscript metablock and append on.
Metakeys documents:
- [Tampermonkey](https://tampermonkey.net/documentation.php)
- [Greasemonkey](https://wiki.greasespot.net/Metadata_Block)
- [Violentmonkey](https://violentmonkey.github.io/api/metadata-block/)
- [GreasyFork](https://greasyfork.org/help/meta-keys)## Installation
```sh
npm install --save-dev rollup-plugin-userscript-metablock
```## Usage
simplest
```js
import metablock from 'rollup-plugin-userscript-metablock';export default {
input: 'main.js',
output: {
file: 'bundle.user.js',
format: 'esm'
},
plugins: [metablock()],
};
```common
```js
import metablock from 'rollup-plugin-userscript-metablock';const pkg = require('package.json');
export default {
input: 'main.js',
output: {
file: 'bundle.user.js',
format: 'esm'
},
plugins: [metablock({
file: './meta.json',
override: {
name: pkg.name,
version: pkg.version,
description: pkg.description,
homepage: pkg.homepage,
author: pkg.author,
license: pkg.license,
}
})],
};
```You can find the options detail [here](./docs/options.md), and meta details [here](./docs/meta.md).
### Other
1. If no grant, use `@grant none` explicitly
- Greasemonkey treat no set as `@grant none`. [Ref](https://wiki.greasespot.net/@grant)
- Tampermonkey treat no set as grant you use but some need declare explicitly. [Ref](https://tampermonkey.net/documentation.php#_grant)
- Both can use info (`GM_info` / `GM.info`) without grant
- **Idea:** Maybe add a todo that inspect code to auto generate grant## License
MIT