ng build --prod is extremely slow
Increasing node's allotted memory size really sped things up for me. You can see here I gave it an entire 8GB as opposed to the default 512MB.
> node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod
If you are unsure of how much memory your machine has available use the following command to see memory stats based on MB, check under the available
column not the free
column.
> free -m
total used free shared buff/cache available
Mem: 15866 1490 3726 116 10650 13929