Can you use NextJS rewrites *only* in development?

My company is incrementally adopting Next (hooray) - but the app is currently being statically exported and served from a Spring Boot app for now (boo).

I’d like to have a setup similar to Vite’s server.config where requests to /api can be proxied to an external server during development, but not in production.

However, next doesn’t seem to allow output: export and rewrites at the same time, but I don’t mind if rewrites stops working in production.
Was this page helpful?