Build failed after npm run build

I’m trying to deploy a MERN app, when I try and deploy the front-end I run into issues as the front-end is in a sub-directory (client folder) and when I run npm run build it creates a dist folder in the root directory so I can’t point to the the publish folder (dist) in settings as it defaults to the client folder in settings, is there a solution to this issue?

I got it working, I changed the location of the dist folder in webpack.config.js