@keqingrong/react-native-cli-apis
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@keqingrong/react-native-cli-apis (WIP)

npm version

Programmatic APIs for React Native CLI

Installation

# npm
npm install @keqingrong/react-native-cli-apis

# yarn
yarn add @keqingrong/react-native-cli-apis

Usage

import { bundle, setPATH } from '@keqingrong/react-native-cli-apis';

(async () => {
  const config = {
    entryFile: 'index.js',
    platform: 'android',
    dev: false,
    resetCache: false,
    bundleOutput: './build/index.android.jsbundle',
    sourcemapOutput: './build/index.android.map',
    assetsDest: './build/assets',
  };
  const basePath = __dirname;
  const spawnOptions = {
    cwd: basePath,
    env: setPATH(basePath, process.env),
  };

  info('Building bundle for Android\n');
  await bundle(config, spawnOptions);
  info('Done building bundle for Android');
})();

APIs

  • bundle(config) Builds the JavaScript bundle for offline use
  • version() Print React Native CLI version

License

MIT © Qingrong Ke

Package Sidebar

Install

npm i @keqingrong/react-native-cli-apis

Weekly Downloads

6

Version

0.5.0

License

MIT

Unpacked Size

75.3 kB

Total Files

14

Last publish

Collaborators

  • dearke