When I run production build in angular app, I'm getting FatalProcessOutOfMemory error.
- angular 6.0.8
- type script :2.7.2
When I run production build in angular app, I'm getting FatalProcessOutOfMemory error.

For prod build, run following command:
node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build --target production
For more optimization flags, below command:
It has inbuilt cache busting and other goodies:
node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build --target production --build-optimizer --vendor-chunk
Navigate to AppData->Roming->npm
Open ng.cmd file and replace with below code :
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "--max_old_space_size=8192" "%~dp0\node_modules\@angular\cli\bin\ng" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "--max_old_space_size=8192" "%~dp0\node_modules\@angular\cli\bin\ng" %*
)
and save it.