在create-react-app项目中增加JavaScript堆大小 [英] Increase JavaScript Heap size in create-react-app project

查看:91
本文介绍了在create-react-app项目中增加JavaScript堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Node features the way to increase the heap size via passing in the --max-old-space-size command line flag. In create-react-app projects everything depends on the use of react-scripts. How can I pass in this parameter in such projects and where should I best do that?

感谢您的帮助。

推荐答案

非常感谢@ dan-abramov,他的评论就是答案! (如果你遇到这个问题,请给他投票。)

Thanks a lot to @dan-abramov as his comment is the answer! (Give him the vote up in case you come across this).

你可以把 node --max_old_space_size = 4096 node_modules / .bin / react-scripts start 而不是 react-scripts start

这篇关于在create-react-app项目中增加JavaScript堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆