Why not simply increase to 4048 then? I used to hit this error on build process, so this line just works.
NODE_OPTIONS=--max-old-space-size=4096 npm run build