@@ -90,10 +90,11 @@ ReactPackager is how you mainly interact with the API.
90
90
var ReactPackager = require (' ./react-packager' );
91
91
```
92
92
93
- ### ReactPackager.middleware(options )
93
+ ### ReactPackager.buildBundle(serverOptions, bundleOptions )
94
94
95
- Returns a function that can be used in a connect-like
96
- middleware. Takes the following options:
95
+ Builds a bundle according to the provided options.
96
+
97
+ #### ` serverOptions `
97
98
98
99
* ` projectRoots ` array (required): Is the roots where your JavaScript
99
100
file will exist
@@ -109,21 +110,25 @@ middleware. Takes the following options:
109
110
* ` nonPersistent ` boolean, defaults to false: Whether the server
110
111
should be used as a persistent deamon to watch files and update
111
112
itself
112
- * ` assetRoots ` array: Where should the packager look for assets
113
113
* ` getTransformOptionsModulePath ` string: Path to module that exports a function
114
114
that acts as a middleware for generating options to pass to the transformer
115
- based on the bundle and module being transformed.
116
-
117
- ### ReactPackager.buildPackageFromUrl(options, url)
118
-
119
- Build a package from a url (see the ` .bundle ` endpoint). ` options ` is
120
- the same options that is passed to ` ReactPackager.middleware `
115
+ based on the bundle being built.
121
116
122
- ### ReactPackager.getDependencies(options, main)
117
+ #### ` bundleOptions `
123
118
124
- Given an entry point module. Recursively collect all the dependent
125
- modules and return it as an array. ` options ` is the same options that
126
- is passed to ` ReactPackager.middleware `
119
+ * ` entryFile ` string (required): the entry file of the bundle, relative to one
120
+ of the asset roots.
121
+ * ` dev ` boolean (defaults to ` true ` ): sets a global ` __DEV__ ` variable
122
+ which will effect how the React Native core libraries behave.
123
+ * ` minify ` boolean: Whether to minify code and apply production optimizations.
124
+ * ` runModule ` boolean (defaults to ` true ` ): whether to require your entry
125
+ point module.
126
+ * ` inlineSourceMap ` boolean, defaults to false: whether to inline
127
+ source maps.
128
+ * ` platform ` string: The target platform for the build
129
+ * ` generateSourceMaps ` boolean: Whether to generate source maps.
130
+ * ` sourceMapUrl ` string: The url of the source map (will be appended to
131
+ the bundle).
127
132
128
133
## Debugging
129
134
0 commit comments