Skip to content

Instantly share code, notes, and snippets.

View mixxorz's full-sized avatar

Mitchel Cabuloy mixxorz

View GitHub Profile
@mixxorz
mixxorz / README.md
Last active March 6, 2025 10:03
Tampermonkey script that allows you to test your CSS/JS on staging/production sites without a deployment

Local Dev Redirector

Redirect requests for specific JS/CSS files to your local versions for development.

I sometimes find myself needing to test my local development JS/CSS files on staging/production without actually comitting the file and making a deployment. This can be because staging/production has specific content that you can't replicate locally, or if one or more of your front-end components need to execute on the correct domain.

So I (cough ChatGPT) wrote this script that replaces the URLs in the <script> and tags that you specify. More than that, it can also redirect requests for specific endpoints to your local development server for further testing flexibility.

Usage