lisonge / vite-plugin-monkey

A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat
MIT License
1.24k stars 65 forks source link

In tampermonkey, disable <script> on dev, disable server:<script> on preview? (only 1 script active at any time) #167

Closed henrikvilhelmberglund closed 3 weeks ago

henrikvilhelmberglund commented 3 weeks ago

Is there any way to not have to disable the built script when going back to dev? I end up with both the server script and the client script running at the same time so the script runs twice.

lisonge commented 3 weeks ago

what is server script and client script ?

henrikvilhelmberglund commented 3 weeks ago

what is server script and client script ?

Sorry for the poor explanation, server script is the result of npm run dev, client script is the result of npm run build and npm run preview.

So: (in tampermonkey dashboard) npm run dev -> server<script> npm run build and npm run preview -> <script>

After dev and build&preview I end up with two scripts which is fine when the development server is offline, however when I want to edit the script again I have two active scripts. I would like to know if there is a way to automatically disable the built client script when running npm run dev and also disable the development server script when running npm run preview.

lisonge commented 3 weeks ago

set server.prefix to false

henrikvilhelmberglund commented 3 weeks ago

set server.prefix to false

😨 Thanks!