Last I checked, I think with nextjs, if you want to build once and deploy with different base paths (without having to rebuild), this is impossible, since the base path is hardcoded all over the build. This makes some forms of deployment of nextjs sites much more difficult than with other frameworks.