Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for plugin-react #16

Open
thcrt opened this issue Feb 23, 2025 · 0 comments
Open

Support for plugin-react #16

thcrt opened this issue Feb 23, 2025 · 0 comments

Comments

@thcrt
Copy link

thcrt commented Feb 23, 2025

In development environments, a script needs to be added to pages that looks like this:

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

(source)

It would be good if flask-vite were to include this when calling {{ vite_tags() }} in development environments. In production, this shouldn't be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant