You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vite-plugin-userscript

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-userscript

## Get Started

0.1.3
latest
Source
npmnpm
Version published
Weekly downloads
339
-20.42%
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-userscript

Get Started

pnpm i -D vite-plugin-userscript
// vite.config.js

import { defineConfig } from 'vite';
import { metablock } from 'vite-plugin-userscript';

export default defineConfig({
  plugins: [
    metablock(),
  ],
  build: {
    lib: {
      entry: 'index.js',
      name: 'my-awesome-userscript',
    },
    rollupOptions: {
      output: {
        extend: true,
        format: 'umd',
        entryFileNames: 'my-awesome-userscript.user.js',
      },
    },
  },
});

Full options


metablock({
  // support json / json5 / yaml.
  file: './metablock.json',

  // show hints if you only want to write for specific script manager.
  manager: 'all',

  // dynamic override the meta from meta file
  override: {
    name: require('package.json').name
  },

  order: ['name', 'description', 'namespace', '...', 'grant'],

  // the action when meet invalid meta
  errorLevel: 'warn'

  // append metablock to which output files
  applyTo: /[.]user[.]js$/
})

Examples

See examples folder

License

MIT

Keywords

userscript

FAQs

Package last updated on 08 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts