frappe-ui icon indicating copy to clipboard operation
frappe-ui copied to clipboard

Vite hot reload on Windows with WSL

Open cdiethelm opened this issue 2 years ago • 1 comments

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?

cdiethelm avatar Mar 13 '24 06:03 cdiethelm

@cdiethelm does vite hmr not work at all when you're editing frappe-ui dir?

siduck avatar Nov 25 '25 09:11 siduck