Skip to content
 
 

Latest commit

 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rolldown-plugin-userscript

Warning

This breaks in production due to Rolldown stripping the comments. See this wiki entry to fix production / minified builds

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 rolldown.config.js:

import userscript from 'rolldown-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';

Tip

You can use multiple metadata files now, this helps for projects with multiple userscripts that they don't want to combine!

About

I like my UserScript building in less than 3 seconds bruh

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages