UNPKG

15.5 kBMarkdownView Raw
1<p align="center">
2 <img alt="Haul" src="https://cloud.githubusercontent.com/assets/1174278/24502391/25619f98-156b-11e7-994c-a8495b4735d5.png" width="512">
3</p>
4
5<p align="center">
6 A command line tool for developing React Native apps
7</p>
8
9---
10
11[![Build Status][build-badge]][build]
12[![Version][version-badge]][package]
13[![MIT License][license-badge]][license]
14
15
16[![All Contributors][all-contributors-badge]](#contributors)
17[![PRs Welcome][prs-welcome-badge]][prs-welcome]
18[![Code of Conduct][coc-badge]][coc]
19
20[![Chat][chat-badge]][chat]
21[![tweet][tweet-badge]][tweet]
22
23Haul is a drop-in replacement for `react-native` CLI built on open tools like Webpack. It can act as a development server or bundle your React Native app for production.
24
25## Features
26
27- Replaces React Native packager to bundle your app
28- Access to full webpack ecosystem, using additional loaders and plugins is simple
29- Doesn't need watchman, symlinks work nicely
30- Helpful and easy to understand error messages
31- Hot Module Reloading
32
33## Getting started
34
35Start by adding Haul as a dependency to your React Native project (use `react-native init MyProject` to create one if you don't have a project):
36
37```bash
38yarn add --dev haul
39# Traditionalist? No problem:
40npm install --save-dev haul
41```
42
43To configure your project to use haul, run the following:
44
45```bash
46yarn haul init
47# npm >= 5.2.0 :
48npx haul init
49# npm < 5.2.0 :
50npm install -g npx
51npx haul init
52```
53
54This will automatically add the configuration needed to make Haul work with your app, e.g. add `webpack.haul.js` to your project, which you can customise to add more functionality.
55
56Next, you're ready to start the development server:
57
58```bash
59yarn haul start -- --platform ios
60# Or:
61npx haul start --platform ios
62```
63
64Finally, reload your app to update the bundle or run your app just like you normally would:
65
66```bash
67react-native run-ios
68```
69
70<p align="center">
71 <img width="635" src="https://cloud.githubusercontent.com/assets/2464966/24395888/8957aba8-13a1-11e7-96a3-70d34d4b5069.png" />
72</p>
73
74## Documentation
75
76Check out the docs to learn more about available commands and tips on customizing the webpack configuration.
77
781. [CLI Commands](docs/CLI%20Commands.md)
791. [Configuration](docs/Configuration.md)
801. [Recipes](docs/Recipes.md)
81
82### Hot Module Replacement
83Please refer to the [Setup guide](./docs/HMR_Setup.md).
84
85## Limitations
86
87Haul uses a completely different architecture from React Native packager, which means there are some things which don't work quite the same.
88
89We are actively working on adding support for the following:
90
91- Delta Bundles (RN 0.52+)
92
93Currently we don't support delta bundles (metro feature) (Android). To make Haul work with `RN 0.52+`, you have to disable that feature - During development, bring up Dev Menu (`cmd + m`), select `Dev Settings` and uncheck `Delta bundles`
94
95- Existing `react-native` commands
96
97The following features are **unlikely to be supported** in the future:
98
99- Haste module system: use something like [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) instead
100- Transpile files under `node_modules`: transpile your modules before publishing, or configure webpack not to ignore them
101
102# Contributors
103
104Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
105
106<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
107| [<img src="https://avatars2.githubusercontent.com/u/2464966?v=4" width="100px;"/><br /><sub>Mike Grabowski</sub>](https://twitter.com/grabbou)<br />[πŸ’¬](#question-grabbou "Answering Questions") [πŸ’»](https://github.com/grabbou/haul/commits?author=grabbou "Code") [🎨](#design-grabbou "Design") [πŸ“–](https://github.com/grabbou/haul/commits?author=grabbou "Documentation") [πŸ’‘](#example-grabbou "Examples") [πŸ€”](#ideas-grabbou "Ideas, Planning, & Feedback") [πŸ‘€](#review-grabbou "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/1174278?v=4" width="100px;"/><br /><sub>Satyajit Sahoo</sub>](https://twitter.com/satya164)<br />[πŸ’¬](#question-satya164 "Answering Questions") [πŸ’»](https://github.com/grabbou/haul/commits?author=satya164 "Code") [🎨](#design-satya164 "Design") [πŸ€”](#ideas-satya164 "Ideas, Planning, & Feedback") [πŸ‘€](#review-satya164 "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/17573635?v=4" width="100px;"/><br /><sub>PaweΕ‚ TrysΕ‚a</sub>](https://twitter.com/_zamotany)<br />[πŸ’¬](#question-zamotany "Answering Questions") [πŸ›](https://github.com/grabbou/haul/issues?q=author%3Azamotany "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=zamotany "Code") [πŸ“–](https://github.com/grabbou/haul/commits?author=zamotany "Documentation") [πŸ’‘](#example-zamotany "Examples") [πŸ€”](#ideas-zamotany "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/6444719?v=4" width="100px;"/><br /><sub>Krzysztof Borowy</sub>](https://twitter.com/Krizzu)<br />[πŸ’¬](#question-Krizzu "Answering Questions") [πŸ›](https://github.com/grabbou/haul/issues?q=author%3AKrizzu "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=Krizzu "Code") [πŸ€”](#ideas-Krizzu "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/5106466?v=4" width="100px;"/><br /><sub>MichaΕ‚ PierzchaΕ‚a</sub>](https://twitter.com/thymikee)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=thymikee "Code") [πŸ€”](#ideas-thymikee "Ideas, Planning, & Feedback") [⚠️](https://github.com/grabbou/haul/commits?author=thymikee "Tests") | [<img src="https://avatars0.githubusercontent.com/u/68273?v=4" width="100px;"/><br /><sub>Steve Kellock</sub>](https://github.com/skellock)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=skellock "Code") | [<img src="https://avatars2.githubusercontent.com/u/3254314?v=4" width="100px;"/><br /><sub>Mathieu Dutour</sub>](https://mathieu.dutour.me)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=mathieudutour "Code") |
108| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
109| [<img src="https://avatars2.githubusercontent.com/u/49038?v=4" width="100px;"/><br /><sub>Orta</sub>](http://orta.io)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=orta "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/5436545?v=4" width="100px;"/><br /><sub>Yann Pringault</sub>](https://github.com/Kerumen)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=Kerumen "Code") [πŸ“–](https://github.com/grabbou/haul/commits?author=Kerumen "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/16336501?v=4" width="100px;"/><br /><sub>Drapich Piotr</sub>](https://github.com/dratwas)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=dratwas "Code") [πŸ“–](https://github.com/grabbou/haul/commits?author=dratwas "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/387794?v=4" width="100px;"/><br /><sub>JΓΊlio CΓ©sar</sub>](http://julioc.me)<br />[πŸ›](https://github.com/grabbou/haul/issues?q=author%3AJulioC "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=JulioC "Code") | [<img src="https://avatars0.githubusercontent.com/u/1216029?v=4" width="100px;"/><br /><sub>LiJung Chi</sub>](http://chilijung.me)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=chilijung "Code") | [<img src="https://avatars1.githubusercontent.com/u/6403450?v=4" width="100px;"/><br /><sub>spypsy</sub>](https://github.com/spypsy)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=spypsy "Code") | [<img src="https://avatars1.githubusercontent.com/u/12488826?v=4" width="100px;"/><br /><sub>Juwan Wheatley</sub>](https://fiber-god.github.io/)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=fiber-god "Documentation") |
110| [<img src="https://avatars2.githubusercontent.com/u/3100817?v=4" width="100px;"/><br /><sub>Jeremi Stadler</sub>](http://jeremi.se)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=jeremistadler "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/1242537?v=4" width="100px;"/><br /><sub>David Sheldrick</sub>](https://github.com/ds300)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=ds300 "Code") | [<img src="https://avatars3.githubusercontent.com/u/5677929?v=4" width="100px;"/><br /><sub>Miguel Oller</sub>](https://twitter.com/ollermi)<br />[πŸ›](https://github.com/grabbou/haul/issues?q=author%3Amigueloller "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=migueloller "Code") | [<img src="https://avatars3.githubusercontent.com/u/12470911?v=4" width="100px;"/><br /><sub>Krzysztof Karol</sub>](https://github.com/KrzysztofKarol)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=KrzysztofKarol "Code") | [<img src="https://avatars1.githubusercontent.com/u/7150839?v=4" width="100px;"/><br /><sub>Jakub Stasiak</sub>](https://github.com/jakubsta)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=jakubsta "Code") | [<img src="https://avatars2.githubusercontent.com/u/774577?v=4" width="100px;"/><br /><sub>Ferran Negre</sub>](http://twitter.com/ferrannp)<br />[πŸ›](https://github.com/grabbou/haul/issues?q=author%3Aferrannp "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=ferrannp "Code") | [<img src="https://avatars2.githubusercontent.com/u/26751770?v=4" width="100px;"/><br /><sub>CL123123</sub>](https://github.com/CL123123)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=CL123123 "Documentation") |
111| [<img src="https://avatars0.githubusercontent.com/u/1819798?v=4" width="100px;"/><br /><sub>Marty Penner</sub>](http://penner.me)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=martypenner "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/108938?v=4" width="100px;"/><br /><sub>Jim Cummins</sub>](https://jimthedev.com)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=jimthedev "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/997157?v=4" width="100px;"/><br /><sub>Gant Laborde</sub>](https://github.com/GantMan)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=GantMan "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1809192?v=4" width="100px;"/><br /><sub>PaweΕ‚ Burniak</sub>](https://github.com/mitcom)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=mitcom "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/25077318?v=4" width="100px;"/><br /><sub>bsnelder</sub>](https://github.com/bsnelder)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=bsnelder "Code") | [<img src="https://avatars2.githubusercontent.com/u/4400726?v=4" width="100px;"/><br /><sub>aivΓ¦n</sub>](https://ivan.moe/)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=SEAPUNK "Code") | [<img src="https://avatars2.githubusercontent.com/u/9661806?v=4" width="100px;"/><br /><sub>Nemanja Stojanovic</sub>](https://nem035.com)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=nem035 "Code") |
112| [<img src="https://avatars3.githubusercontent.com/u/2010912?v=4" width="100px;"/><br /><sub>bogdanbolchis</sub>](https://github.com/bogdanbolchis)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=bogdanbolchis "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/3767?v=4" width="100px;"/><br /><sub>Joe Arasin</sub>](http://joe.arasin.com)<br />[πŸ›](https://github.com/grabbou/haul/issues?q=author%3Ajoearasin "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=joearasin "Code") | [<img src="https://avatars2.githubusercontent.com/u/3070389?v=4" width="100px;"/><br /><sub>Norbert de Langen</sub>](https://github.com/ndelangen)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=ndelangen "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/6381792?v=4" width="100px;"/><br /><sub>Gustav Wengel</sub>](http://gustavwengel.dk)<br />[πŸ“–](https://github.com/grabbou/haul/commits?author=GeeWee "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/1930227?v=4" width="100px;"/><br /><sub>Eric Wooley</sub>](http://ericwooley.github.io)<br />[πŸ›](https://github.com/grabbou/haul/issues?q=author%3Aericwooley "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=ericwooley "Code") | [<img src="https://avatars2.githubusercontent.com/u/6714912?v=4" width="100px;"/><br /><sub>Matt Cubitt</sub>](https://github.com/mattcubitt)<br />[πŸ›](https://github.com/grabbou/haul/issues?q=author%3Amattcubitt "Bug reports") [πŸ’»](https://github.com/grabbou/haul/commits?author=mattcubitt "Code") | [<img src="https://avatars3.githubusercontent.com/u/8135252?v=4" width="100px;"/><br /><sub>Jakub BeneΕ‘</sub>](https://jukben.cz)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=jukben "Code") |
113| [<img src="https://avatars2.githubusercontent.com/u/397824?v=4" width="100px;"/><br /><sub>Tasveer Singh</sub>](http://twitter.com/tazsingh)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=tazsingh "Code") | [<img src="https://avatars3.githubusercontent.com/u/10349378?v=4" width="100px;"/><br /><sub>Luke Czyszczonik</sub>](https://github.com/czystyl)<br />[πŸ’»](https://github.com/grabbou/haul/commits?author=czystyl "Code") [πŸ’‘](#example-czystyl "Examples") |
114<!-- ALL-CONTRIBUTORS-LIST:END -->
115
116This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
117
118<!-- badges -->
119[build-badge]: https://img.shields.io/circleci/project/github/callstack/haul/master.svg?style=flat-square
120[build]: https://circleci.com/gh/callstack/haul
121[version-badge]: https://img.shields.io/npm/v/haul.svg?style=flat-square
122[package]: https://www.npmjs.com/package/haul
123[license-badge]: https://img.shields.io/npm/l/haul.svg?style=flat-square
124[license]: https://github.com/callstack/haul/blob/master/LICENSE
125[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
126[prs-welcome]: http://makeapullrequest.com
127[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
128[coc]: https://github.com/callstack/haul/blob/master/CODE_OF_CONDUCT.md
129[all-contributors-badge]: https://img.shields.io/badge/all_contributors-34-orange.svg?style=flat-square
130[chat-badge]: https://img.shields.io/discord/426714625279524876.svg?style=flat-square&colorB=758ED3
131[chat]: https://discord.gg/zwR2Cdh
132[tweet-badge]: https://img.shields.io/badge/tweet-%23haul-blue.svg?style=flat-square&colorB=1DA1F2&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAAAAXNSR0IArs4c6QAAAaRJREFUOBGtlM8rBGEYx3cWtRHJRaKcuMtBSitxkCQ3LtzkP9iUUu5ODspRHLhRLtq0FxeicEBC2cOivcge%2FMgan3fNM8bbzL4zm6c%2BPT%2Fe7%2FO8887svrFYBWbbtgWzsAt3sAcpqJFxxF1QV8oJFqFPFst5dLWQAT87oTgPB7DtziFRT1EA4yZolsFkhwjGYFRO8Op0KD8HVe7unoB6PRTBZG8IctAmG1xrHcfkQ2B55sfI%2ByGMXSBqV71xZ8CWdxBxN6ThFuECDEAL%2Bc9HIzDYumVZ966GZnX0SzCZvEqTbkaGywkyFE6hKAsBPhFQ18uPUqh2ggJ%2BUor%2F4M%2F%2FzOC8g6YzR1i%2F8g4vvSI%2ByD7FFNjexQrjHd8%2BnjABI3AU4Wl16TuF1qANGll81jsi5qu%2Bw6XIsCn4ijhU5FmCJpkV6BGNw410hfSf6JKBQ%2FUFxHGYBnWnmOwDwYQ%2BwzdHqO75HtiAMJfaC7ph32FSRJCENUhDHsLaJkL%2FX4wMF4%2BwA5bgAcrZE4sr0Cu9Jq9fxyrvBHWbNkMD5CEHWTjjT2m6r5D92jfmbbKJEWuMMAAAAABJRU5ErkJggg%3D%3D
133[tweet]: https://twitter.com/intent/tweet?text=Check%20out%20Haul!%20https://github.com/callstack/haul%20%F0%9F%91%8D