Whenever I run my app I always see in my Developer Tools that
DEV === true, development-level warning are ON, performance optimizations are OFF
How can I set Performance Optimisation to ON and DEV to False?
The DEV
mode is automatically turned off, when you create the production javascript bundle. Typically you don't need to do this yourself, as the packager creates the bundle when you run the XCode Archive task or Android deploy.
However, you can create the bundle manually with the react-native bundle --dev=false
command, e.g.
react-native bundle --dev=false --entry-file=index.ios.js --bundle-output=app.jsbundle --platform=ios
The bundle
command takes the following options:
react-native bundle [options]
builds the javascript bundle for offline use
Options:
-h, --help output usage information
--entry-file <path> Path to the root JS file, either absolute or relative to JS root
--platform [string] Either "ios" or "android"
--transformer [string] Specify a custom transformer to be used
--dev [boolean] If false, warnings are disabled and the bundle is minified
--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle
--bundle-encoding [string] Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).
--sourcemap-output [string] File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map
--assets-dest [string] Directory name where to store assets referenced in the bundle
--verbose Enables logging
--reset-cache Removes cached files
--read-global-cache Try to fetch transformed JS code from the global cache, if configured.
--config [string] Path to the CLI configuration file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With