userscript-metadata-rollup-plugin
v0.0.1
Published
A rollup plugin to generate userscript metadata and prepend to js
Downloads
11
Maintainers
Readme
userscript-metadata-rollup-plugin
userscript-metadata-rollup-plugin
is a webpack plugin to
generate userscript metadata comments for UserScript.
require:
- webpack 5
- nodejs >= 16
usage
you can find a full template project in webpack-userscript-template
install
npm i userscript-metadata-rollup-plugin -D
configure
webpack.config.js
const pkg = require('../package.json');
const {UserScriptMetaDataPlugin} = require('userscript-metadata-rollup-plugin');
const config = {
// ...
// ...
plugins: [
new UserScriptMetaDataPlugin({
metadata: {...},
test: /\.user\.js$/, // optional, default /\.user\.js$/
}),
],
};
module.exports = config;
you can see more details about metadata here https://github.com/trim21/userscript-metadata-generator