How can I use buck to build react-native apps for both iOS and Android

前端 未结 2 937
无人及你
无人及你 2020-12-28 16:17

Buck sounds like a great tool for both iOS and Android projects but I have not been abel to find any information on how to use it for react-native projects.

2条回答
  •  温柔的废话
    2020-12-28 17:08

    There's no official documentation / template for building RN apps with Buck yet but it shouldn't be that hard. You'd need to add a BUCK file that does the equivalent of what your build.gradle file does.

    It's mostly just:

    • Declares an Android app with a dependency on React Native from JCenter (Buck has the android_binary rule to do that)
    • In release mode it also bundles the JS into your app's assets folder. You could skip this for a start (in dev mode the app fetches the JS from localhost at runtime) but I believe Buck has built-in support for bundling JS too.

提交回复
热议问题