lisonge / vite-plugin-monkey

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

can not work with vite plugin @vitejs/plugin-react #3

Closed lisonge closed 2 years ago

lisonge commented 2 years ago

@vitejs/plugin-react will inject

  <script type="module">
import RefreshRuntime from "/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>

to index.html document.head

but vite-plugin-monkey existing installation mode will just inject /@vite/client and /src/main.jsx

so React and @vitejs/plugin-react can not work with vite-plugin-monkey

finallly, vite-plugin-monkey need to use other installation

lisonge commented 2 years ago

try fix by https://github.com/lisonge/vite-plugin-monkey/releases/tag/v1.0.0-alpha.0

lisonge commented 2 years ago

fixed -> https://github.com/lisonge/vite-plugin-monkey/blob/v1.0.0/CHANGELOG.md#100