RepackPlugin
This is the main plugin that enables React Native app development & bundling with Re.Pack and should be included in all of your configurations. It abstracts the configuration of other core internal plugins into one plugin.
Plugins configured by the RepackPlugin are considered internal and there is no need to use or configure them directly. Their use is heavily discouraged and they are only included for the sake of completeness of the API.
You can learn more about internal plugins here.
Usage
Options
platform
- Type:
string - Default:
compiler.options.name
Target application platform. This value is used by various plugins to determine platform-specific behavior. The default value is the name of the compiler which Re.Pack sets to the target platform.
logger
- Type:
Object | boolean - Default:
{ console: true }
Options to configure the logger's output. Setting this to false disables the LoggerPlugin completely. When set to true or left undefined, it uses default logger configuration with console output enabled.
logger.console
- Type:
boolean - Default:
true
Enable or disable logging to the console. When enabled, build progress, warnings, errors, and other messages will be displayed in the terminal.
You can enable verbose logging by passing --verbose flag to either of CLI commands or by setting the REPACK_VERBOSE environment variable to 1 or true.
logger.file
- Type:
string - Default:
undefined
Absolute path to a file where logs should be saved. If not specified, file logging will be disabled.
logger.listener
- Type:
(log: LogEntry) => void - Default:
undefined
Custom listener function that will be called for each log entry.
output
- Type:
Object - Default:
{}
Options are passed directly to the OutputPlugin.
output.auxiliaryAssetsPath
- Type:
string - Default:
undefined
Path to a directory, where remote assets should be saved.
initializeCore
- Type:
string - Default:
require.resolve('react-native/Libraries/Core/InitializeCore.js')
Absolute location to JS file with initialization logic for React Native. This is particularly useful when building for out-of-tree platforms.
extraChunks
- Type:
DestinationSpec[] - Default:
Options specifying how to deal with extra chunks generated in the compilation, usually by using dynamic import() function. Each entry in the array should conform to the DestinationSpec type:
The plugin uses these specifications to classify chunks into two categories:
- Local chunks - Bundled with the main application bundle and included in the
.ipa/.apkfile - Remote chunks - Saved separately and can be downloaded on demand
By default, all chunks are treated as remote and saved under <projectRoot>/build/outputs/<platform>/remotes directory.
Specifying custom value for this option will disable the default setting - you will need to configure outputPath for type: 'remote' yourself.
Example configuration:


