A command line tool for developing React Native apps
We're actively working on a Haul successor, which would provide long awaited features like Hot Module Replacement + React Refresh and better feature-parity with Metro. The version
1.0.0 is already released!
If you're investigating using Haul, we highly recommend giving a Re.pack a go.
If you're already using Haul, we recommend migrating to Re.pack for better developer experience and feature set. The migration process is fairly straighforward, since you now have full access to
Haul 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.
@haul-bundler/cli and other packages under
@haul-bundler scope are a overhaul of
haul package and support only React Native 0.59.0 and above. If you need to support older versions, please check
@haul-bundler/cli and other packages requires Node 10 to be installed. If you're running older version, please upgrade to Node 10 LTS or newer.
||CLI and commands implementation.||Yes|
||Core logic and functionality.||Yes (installed with
||Legacy logic from
||Yes (installed with
||Babel preset tweaked for RN 0.59+, which can decrease the bundle size by using only the necessary transforms.||Yes (installed by
||Webpack plugin with tweaks for plain JS bundle.||Yes (installed with
||Webpack plugin for RAM bundle support.||Yes (installed with
||Preset with configuration tweaked for RN 0.59.||Yes (installed by
||Preset with configuration tweaked for RN 0.60.||Yes (installed by
||Explore and analyse generated bundle||No (optional)|
Start 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):
yarn add --dev @haul-bundler/cli # Traditionalist? No problem: npm install --save-dev @haul-bundler/cli
To configure your project to use haul, run the following:
yarn haul init # npm >= 5.2.0 : npx haul init # npm < 5.2.0 : npm install -g npx npx haul init
This will automatically add the configuration needed to make Haul work with your app, e.g. add
haul.config.js to your project, which you can customize to add more functionality.
Next, you're ready to start the development server:
yarn haul start # Or: npx haul start
Finally, reload your app to update the bundle or run your app just like you normally would:
Check out the docs to learn more about available commands and tips on customizing the webpack configuration.
Haul uses a completely different architecture from React Native packager, which means there are some things which don't work quite the same.
The following features are unlikely to be supported in the future:
node_modules: transpile your modules before publishing, or configure webpack not to ignore them
Haul is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks, contact us at [email protected] if you need any help with these or just want to say hi!
Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥