I have a reactjs/typescript project, running on windows 10. Im trying to build by ts-scripts with
\"rimraf ../wwwroot/* && react-scripts-ts build
The root cause of the problem is the large source file sizes.
You can resolve the issue in 2 steps.
"start": "react-scripts --max_old_space_size=4096 start",
"build": "react-scripts --max_old_space_size=4096 build"
set NODE_OPTIONS=--max_old_space_size=4096
export NODE_OPTIONS=--max_old_space_size=4096
Also note that, if you are using very low memory like 512MB, then you will have to upgrade it to at least 2GB to get the better result.
Here I used 4096MB = 4GB size, but you can change this according to your machine configuration specifically RAM. You can set it to 2GB or 1GB and check the application.