ak-rn-packager
Based on Facebook Packager, support Core & Business JS Separate.
Last updated 4 years ago by mickey .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ak-rn-packager 
SYNC missed versions from official npm registry.

Packager

react-native

Install

$ npm install rn-packager -g

Dependences

"devDependencies": {
  "rn-core": "~0.2.0"
}

"rn-core" 是 0.19.0 的全量sdk工程,你可以 获取 rn-core tag v0.2.1 的代码来精简你的JS核心SDK文件,修改 devDependencies 依赖精简后的工程。

rnpackager bundle

在项目工程根目录下执行打包命令,默认不打包框架代码及polyfills

$ rnpackager bundle --entry-file  entry/file/path.js --bundle-output out/file/path.jsbundle --platform ios

Options, 参数参考react-native命令,增加了--include-framework:

  • --include-framework Whether to bundle include module react-native and polyfills [default: false]

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

url请求参数新增framework=true

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"
  });
});

Project Sample

$ cd tests
$ npm i
$ rnpackager start

Visit:

Current Tags

  • 0.0.4                                ...           latest (4 years ago)

4 Versions

  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 8
Dependencies (71)
Dev Dependencies (0)
None
Dependents (3)

Copyright 2014 - 2017 © taobao.org |