Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.73 KB

DEVELOPMENT.md

File metadata and controls

44 lines (28 loc) · 1.73 KB

Development

  1. Allow Tampermonkey's access to local file URIs tampermonkey/faq
  2. Install deps with npm i or npm ci.
  3. npm run dev to start your development. Now you will see 2 files in /dist/
    • dist/index.dev.proxy.user.js: You should install this userscript in your browser. It's a simple loader that loads dist/index.dev.user.js on matched websites.
    • dist/index.dev.user.js: This is the development build with source-map. It will be automatically loaded by dist/index.dev.user.js. Don't add it to your userscript manager.

Livereload is default enabled, use this Chrome extension

NOTICE

Everytime you change your metadata config, you'll have to restart the webpack server and install the newly generated dist/index.dev.user.js UserScript in your browser again.

Dependencies

There are two ways to using a package on npm.

UserScript way

Like the original UserScript way, you will need to add them to your user script metadata's require section and exclude them in config/webpack.config.base.cjs

Webpack way

Just install packages with npm and import them in your code, webpack will take care them.

Build

npm run build

dist/index.prod.user.js is the final script.

dist/index.prod.meta.js can be used to compare the script version without having to download the whole script.

Automatic Deploy

Github Actions will deploy the production userscript to this Gist on each new version tag.