When I'm making a server build Webpack every time just adds the server part into the existing server.js file under my dist folder.
Say, the file size is 14MB, after executing the build:ssr command the files size will be 28MB and so on. Then I'm trying to execute server:ssr command and it's showing up the error that the port 4000 is already in use. I think that there are duplicates in the newly created server.js file.
In order to have it working I have to prepare a new empty server.js file. Then it creates a working server.js file with a small size.
How to fix the issue?