I understand the "seeking recommendations" close vote, however, I would have gone with "Needs details or clarity".
I would like to uglify the whole source code of the project
It is not exactly clear what you mean by that:
- Do you want to minify the code to make it more compact? This usually leaves it harder to read as well but the purpose of minification is not to attempt to hide code.
- Do you want to obfuscate the code to make it harder to examine? This involves automated re-writing of the code to introduce more control structures and make understanding it harder.
Both end up with the code being "uglier", so which one is it?
There is a further reason why this is not clear: there is a tool for JavaScript code called uglify. A reasonable interpretation of your question is "I want to have a tool that does the same as the uglify too" thus I would be inclined to read your question as seeking to minify the code.
The problem with this interpretation is that Next.js already ships with a built-in minification capability. Thus if you are asking for a tool to minify the source code, I do not understand why Next.js is not sufficient already. Is it not doing it to a sufficient degree? Is the minification from Next.js not fit for your purpose?
Overall, I feel there is missing information in the question. The "seeking recommendations" is probably a red herring in this case. I would expect the question to explain more. For example "I use Next.js and I need result X and Y which I currently do not get when I build the project like this . Here is the toolchain I use ."