koltyakov/sp-rest-proxy

Vite support

rquanx opened this issue · 4 comments

How can i add this proxy into Vite

Had no idea what is Vite. Looks like Next.js but for Vue.

Please check this. You need to route /_api to sp-rest-proxy server.

Please note, this is only for the dev, not prod runtime.

I tried to write a plugin for Vite and started it in the buildStart hook, but there was a problem that Vite would restart the server after the modification and the proxy would be created repeatedly to generate listen EADDRINUSE error.I added the judgment of whether the port is free, but if I save it quickly modify the file,There will still throw exceptions.

normal
image

quick edit
image

Thanks! Going to link your plugin in README.