nativerepo.com

ReactNative Packager


Standalone ReactNative Packager without framework code.

node.js react-native

used with https://github.com/react-component/rn-core

Dependencies

"devDependencies": {
  "rn-packager": "~0.3.0",
  "rn-core": "~0.3.0"
}

"rn-core@~0.3.0" is front end code from react-native 0.21

Bundle

bundle without framework code and polyfill

$ node_modules/rn-packager/bin/rnpackager bundle --entry-file  entry/file/path.js --bundle-output out/file/path.jsbundle --platform ios

added parameters:

  • --include-framework Whether to bundle include module react-native and polyfills [default: false]
  • --runBeforeMainModule Modules required before main module [default: ["InitializeJavaScriptAppEngine"]]

Bundle sdk

$ rnpackager bundle --entry-file node_modules/rn-core/react-native/Libraries/react-native/react-native.js --bundle-output ~/Desktop/react-native-debug.js --platform ios --include-framework

Server

$ rnpackager start

added query parameters: framework=true runBeforeMainModule=[]

Programmatic API

var RNPackager = require('rn-packager');

gulp.task('task', function(){
  return RNPackager.bundle({
    "--entry-file": "tests/index.ios.js",
    "--bundle-output": "tests/index.ios.bundle",
    "--platform": "ios"
  });
});

Demo

$ cd tests
$ npm i
$ rnpackager start

visit:


Comments
Details
Added at: 2017/03/19
Owner: react-component
Category: other
Homepage: https://github.com/react-component/rn-packager#readme
Downloads last month: 410
Version: 0.3.18
Compatibility
  •  
  •  

Add to your project

npm i --save rn-packager
yarn add rn-packager