Giter VIP home page Giter VIP logo

userscript-typescript-template's Introduction

userscript-typescript-template

Template repo using Webpack and TypeScript to build your userscript for Tampermonkey and more extensions.

Automatically generate headers from your package.json!

Usage

1. Generate repostiory (two-ways)

- Use this template to create your new repository

- Clone this repository

# Use Github CLI
$ gh repo clone pboymt/userscript-typescript-template
# Or use 'git clone' command directly
$ git clone https://github.com/pboymt/userscript-typescript-template.git

Development

  1. Install dependencies with npm install or npm ci.
  2. Edit settings in userscript object in package.json, you can refer to the comments in plugins/userscript.plugin.ts.
  3. Code your userscript in src directory (like src/index.ts).
  4. Generate userscript with npm run build.
  5. Import generated userscript to Tampermonkey by local file URI.

Compile other file types

You need install other loader plugins to support other file types.

For example, you can use scss-loader to compile .scss files. Install it with npm install --save-dev scss-loader node-sass and add it in webpack.config.ts.

Debug

Allow Tampermonkey's access to local file URIs (Tampermonkey FAQs) and import built userscript's file URL.

Publish you userscript

You can publish your userscript to Greasy Fork or other websites.

You can push your userscript to Github and import it to Greasy Fork.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.