Skip to content

Commit b0e2b46

Browse files
committed
doc: update README.md
1 parent 1efcf61 commit b0e2b46

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,21 @@
77
Automatically parse metadata and set `@grant`s.
88

99
With this plugin, `@grant`s for [`GM_*` functions](https://violentmonkey.github.io/api/metadata-block/) will be added at compile time.
10+
11+
## Usage
12+
13+
Add the plugin to rollup.config.js:
14+
15+
```js
16+
import userscript from 'rollup-plugin-userscript';
17+
18+
const plugins = [
19+
// ...
20+
userscript(
21+
path.resolve('src/meta.js'),
22+
meta => meta
23+
.replace('process.env.VERSION', pkg.version)
24+
.replace('process.env.AUTHOR', pkg.author),
25+
),
26+
];
27+
```

0 commit comments

Comments
 (0)