How to prevent node from running out of memory when bundling js for React Native

前端 未结 5 2120
误落风尘
误落风尘 2021-01-02 06:01

When bundling js for React Native using ClojureScript I got the following error. It seems that node runs out of memory when bundling the javascript bundle. This is probably

5条回答
  •  萌比男神i
    2021-01-02 06:04

    For android, this can also be set in android/app/build.gradle by adding:

    project.ext.react = [
       // override which node gets called and with what additional arguments
       nodeExecutableAndArgs: ["node", "--max-old-space-size=4096"]
    ]
    

    note that this must be added above the following line:

    apply from: "../../node_modules/react-native/react.gradle"
    

提交回复
热议问题