lisonge / vite-plugin-monkey

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

New options for deploying? #153

Open martixy opened 6 months ago

martixy commented 6 months ago

Discussed in https://github.com/lisonge/vite-plugin-monkey/discussions/150

Originally posted by **martixy** April 22, 2024 I love how easy and seamless this plugin makes development. Chrome has this special feature, where extensions can access file URLs. What I used to do before is create a local file and `@require` it in the script comment with an empty body, which made things simpler - you can use an IDE instead of the built in editor, and you don't need to reimport. For example `@require file:///C:/Users/martixy/Desktop/Scripts/my-script.user.js` The plugin already has the `build.metaFileName` which is really nice, so I think it would be useful to have an option to put the full local build as a require for the meta file only, and maybe also have a command to deploy only the meta+local require. Like maybe a `build.metaFileRequireLocalBuild` config option and a `deploylocal` command (also probably rename the preview command to "deploy" in package.json). You can kind of hack around `vite.config.js` to achieve (most of) the same result, but it'd be nice to have that as a first-party option.

You don't seem to monitor discussions, so moving this over to issues.

lisonge commented 3 months ago

Sorry for the late reply

I don't find any features that attract me. Could you provide a sample code demo.zip or a pull request ?

martixy commented 3 months ago

Seems like someone already made a PR. 😅

I looked it over and it seems exactly what I wanted here.