I’m working on a Next.js project where I need to CRT, which requires using a custom server. I’ve created a server.js file for this purpose. However, I also want to use the output: 'standalone'
option in my next.config.js for optimized builds.
The issue is that when I build the project with output: 'standalone'
, it creates its own server.js file, which conflicts with my custom server.
I’ve attempted to manually copy my server.js into the .next/standalone directory after building, but I’m not sure if this is the correct approach or how to properly configure it to work with the standalone build.
Any guidance on how to properly set this up would be greatly appreciated. Thanks in advance!