Commit Graph

5 Commits

Author SHA1 Message Date
Philipp von Weitershausen dd9b3e13a9 Allow rn-cli.config.js to specify the default transformer
Summary:
This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument.

**Test plan:** Applied this patch to the React Native version in my app, implemented `getTransformModulePath()` in my `rn-cli.config.js`, and verified that my custom transformer is invoked.
Closes https://github.com/facebook/react-native/pull/7961

Differential Revision: D3404201

Pulled By: foghina

fbshipit-source-id: c7eaa85de84d485d06d23a2ffea899821b2cf71c
2016-06-22 08:13:26 -07:00
Chris Liu a1e105eea5 react app root path can be override by env var 'react_native_app_root'
Summary:This PR is to solve app build issue when node_modules is a symlink by providing an environmental variable to override the current *smart* guessing of app root path.
I met this issue when I tried to setup a shared incremental node_modules directory to speed our react-native app build speed in CI. But the build crashed in step 'bundleReleaseJsAndAssets' with error messages like:
> :app:bundleReleaseJsAndAssets
> bundle: Created ReactPackager
> uncaught error Error: NotFoundError: Cannot find entry file index.android.js in any of the roots:["/home/jenkins/shared_data"]

The build is fixed by applying this patch and adding 'export react_native_app_root=${WORKSPACE}' before './gradlew assembleRelease' in build script.

**Test plan**
1. react-native init demo # init a demo app from scratch
2. cd demo/android && ./gradlew assembleRelease # build works fine
3. mkdir ~/shared_data && mv ../node_modules ~/shared_data && cd .. && ln -s ~/shared_data/node_modules . # create symlink for node_modules in shared d
Closes https://github.com/facebook/react-native/pull/6859

Differential Revision: D3150341

fb-gh-sync-id: efbe19b7f6b3053f18d8e568deb75d24861c27ff
fbshipit-source-id: efbe19b7f6b3053f18d8e568deb75d24861c27ff
2016-04-07 07:39:22 -07:00
Martin Konicek 2681200ed6 More descriptive comment in default.config.js
Reviewed By: foghina

Differential Revision: D2575388

fb-gh-sync-id: b28e9ccd7a89409d4d755cfb8d771e5a9e1981b9
2015-11-12 07:43:25 -08:00
Martin Bigio 47926abca9 Use default asset roots on `default.config.js`
Summary: We need to cherry pick this one as well.

cc ide
Closes https://github.com/facebook/react-native/pull/3640

Reviewed By: svcscm

Differential Revision: D2577961

Pulled By: mkonicek

fb-gh-sync-id: 3368fc02a931e0f259f3baa6706bd7d8586b0fbf
2015-10-23 18:49:25 -07:00
Martín Bigio c6c97cbd9d Introduce default config
Reviewed By: frantic

Differential Revision: D2561344

fb-gh-sync-id: 651b8a199069f78e1ace2897ba4c0352aab7e3ea
2015-10-21 03:04:04 -07:00