haul

Haul is a command line tool for developing React Native apps, powered by Webpack

Github星跟踪图


Build Status
MIT License

PRs Welcome
Code of Conduct

Chat
tweet

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 legacy branch.

@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.

Features

  • Replaces React Native packager to bundle your app
  • Access to full webpack ecosystem, using additional loaders and plugins is simple
  • Doesn't need watchman, symlinks work nicely
  • Helpful and easy to understand error messages

Packages, Name, Version, Description, Required, -------------------------------------------, ------------------------------------------------------------------------------------------------------------------, -------------------------------------------------------------------------------------------------------------, ----------------------------------------------------, @haul-bundler/cli, cli version, CLI and commands implementation., Yes, @haul-bundler/core, core version, Core logic and functionality., Yes (installed with cli), @haul-bundler/core-legacy, core-legacy version, Legacy logic from haul package, Yes (installed with cli), @haul-bundler/babel-preset-react-native, babel-preset-react-native version, Babel preset tweaked for RN 0.59+, which can decrease the bundle size by using only the necessary transforms., Yes (installed by init command), @haul-bundler/basic-bundle-webpack-plugin, basic-bundle-webpack-plugin version, Webpack plugin with tweaks for plain JS bundle., Yes (installed with cli), @haul-bundler/ram-bundle-webpack-plugin, ram-bundle-webpack-plugin version, Webpack plugin for RAM bundle support., Yes (installed with cli), @haul-bundler/preset-0.59, preset-0.59 version, Preset with configuration tweaked for RN 0.59., Yes (installed by init command when using RN 0.59), @haul-bundler/preset-0.60, preset-0.60 version, Preset with configuration tweaked for RN 0.60., Yes (installed by init command when using RN 0.60), @haul-bundler/inspector, inspector version, Haul inspector with haul-inspector binary., No (optional)., @haul-bundler/inspector-events, inspector-events version, Shared logic between cli and Haul inspector., Yes (installed with cli), @haul-bundler/explore, explore version, Explore and analyse generated bundle, No (optional), ## Getting started

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:

react-native run-ios

Documentation

Check out the docs to learn more about available commands and tips on customizing the webpack configuration.

  1. CLI Commands
  2. Configuration
  3. Recipes
  4. Migration guide

Limitations

Haul uses a completely different architecture from React Native packager, which means there are some things which don't work quite the same.

  • Delta Bundles (RN 0.52+) have minimal support
  • Existing react-native commands
  • No support for Hot Module Replacement

The following features are unlikely to be supported in the future:

  • Haste module system: use something like babel-plugin-module-resolver instead
  • Transpile files under node_modules: transpile your modules before publishing, or configure webpack not to ignore them

Made with ❤️ at Callstack

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 hello@callstack.com if you need any help with these or just want to say hi!

主要指标

概览
名称与所有者callstack/haul
主编程语言TypeScript
编程语言JavaScript (语言数: 11)
平台
许可证MIT License
所有者活动
创建于2017-03-20 20:23:31
推送于2022-03-09 23:54:54
最后一次提交2021-09-30 14:26:04
发布数162
最新版本名称13-04-2021 (发布于 )
第一版名称v0.1.0 (发布于 2017-03-30 21:05:41)
用户参与
星数3.7k
关注者数42
派生数192
提交数576
已启用问题?
问题数352
打开的问题数43
拉请求数368
打开的拉请求数5
关闭的拉请求数44
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?