Skip to content
/ usb Public

Utilities for building userscripts

License

Notifications You must be signed in to change notification settings

bluwy/usb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@bluwy/usb

Utilities for building userscripts.

Usage

It's recommended to setup your own build script, for example:

import { build, getUserscriptManagerOutDir } from '@bluwy/usb'

await build({
  input: 'src/index.ts',
  outDir: 'dist',
  // Optional: copy the built userscript to the userscript manager's directory
  copyOutDir: [getUserscriptManagerOutDir('Userscripts')],
  // Optional: enable watch mode by passing "dev" as a positional argument
  watch: process.argv[2] === 'dev',
  // Custom userscript metadata, you may want to configure `namespace`, `match`,
  // `icon`, `grant`, etc.
  userscriptMeta: {
    grant: 'none',
  },
})

package.json:

{
  "scripts": {
    "dev": "node scripts/build.js dev",
    "build": "node scripts/build.js build"
  }
}

Then run npm run build to build the userscript, or npm run dev to enable watch mode.

Sponsors

Sponsors

License

MIT

About

Utilities for building userscripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published