When running bigger applications you might run into the memory limit of node. I
had that issue recently with an Angular application.
Usually the build process is triggered through npm run build and the build
process is defined in the package.json the following way:
"scripts": {
...
"build&