在create-react-app项目中增加JavaScript堆大小

节点通过传入--max-old-space-size命令行标志来增加堆大小。 在create-react-app项目中,一切都取决于使用react-scripts。 如何在这样的项目中传递这个参数,我应该在哪里做最好的?

谢谢你的帮助。

感谢@ dan-abramov,他的评论就是答案! (给他的投票,以防万一你碰到这个)。

你可以把例如node --max_old_space_size=4096 node_modules/.bin/react-scripts start在那里而不是react-scripts start