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

Vite hot reload on Windows with WSL #130

Open
cdiethelm opened this issue Mar 13, 2024 · 0 comments
Open

Vite hot reload on Windows with WSL #130

cdiethelm opened this issue Mar 13, 2024 · 0 comments

Comments

@cdiethelm
Copy link

Add hot reload in windows with the following code in ./vite.js for Users developing on Windows.

I've added the watch:{usePolling:true}, after this, hot reload on windows (Docker on WSL2) works.

return {
    name: 'frappeui-vite-plugin',
    config: () => ({
      server: {
        watch: {
          usePolling: true
        },
        port: port,
        proxy: {
          '^/(app|login|api|assets|files)': {
            target: `http://127.0.0.1:${webserver_port}`,
            ws: true,
            router: function (req) {
              const site_name = req.headers.host.split(':')[0]
              return `http://${site_name}:${webserver_port}`
            },
          },
        },
      },
    }),
  }

Is it possible to add this to the code?

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