In TamperMonkey, I set up script header that loads the code from a local file (via @require):
// ==UserScript==
// @name New Script Name
// @namespace rfindley
// @description This script is in development
// @version 1.0.0
// @include /^https://(www|preview).wanikani.com//
// @require file:///M:\projects\my_future_script.js
// @copyright 2020+, Robin Findley
// @license MIT; http://opensource.org/licenses/MIT
// @run-at document-start
// @grant none
// ==/UserScript==
This does require changing a setting in TamperMonkey to allow loading local files:
Then I edit the local file in my favorite editor.
I also sometimes use the browser’s JS console for testing lines of code without reloading (e.g. making sure I’ve typed a selector query correctly, etc).
Does this work for you in Firefox also? Just yesterday I tried this method too, but it seems to work only in Chromium for me. Tampermonkey’s issue tracker lists a few issues with loading local files in Firefox but the situation seems to have changed multiple times and I couldn’t find a definitive answer for the current state.
Apart from that I recently started trying out to build a script with webpack and specific userscript plugin and I really like it so far. May be overhead for simple scripts but I wanted to get more familiar with webpack anyway so this was a good opportunity.
I am not hosting a script anywhere yet, but preventing webpack from minifying/obfuscating the code is a one-liner in the configuration. I tried using rollup two or three times in the past but I never got it to do what I wanted, may have been project specific issues though.
I don’t know yet whether I’ll use Greasy Fork or something else to host the script but it’s good to be aware of their terms, I didn’t know that minifyed code isn’t allowed.