export interface PluginOptions { /** * Enables the [Bundle * Mode](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/). * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#bundlemode} * * - Defaults to `false`. */ bundleMode?: boolean; /** * Turning on this option suppresses a helpful warning when you use [inline * shared * values](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary/#animations-in-inline-styling). * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#disableinlinestyleswarning} * * - Defaults to `false`. */ disableInlineStylesWarning?: boolean; /** * This option turns off the source map generation for worklets. Mostly used * for testing purposes. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#disablesourcemaps} * * - Defaults to `false`. */ disableSourceMaps?: boolean; /** * Disables [Worklet Classes * support](https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/about/#deprecated-worklet-classes). * You might need to disable this feature when using [Custom * Serializables](https://docs.swmansion.com/react-native-worklets/docs/memory/registerCustomSerializable/). * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#disableworkletclasses} * * - Defaults to `false`. */ disableWorkletClasses?: boolean; /** * This is a list of Babel plugins that will be used when transforming * worklets' code with Worklets Babel Plugin. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#extraplugins} * * - Defaults to an empty array `[]`. */ extraPlugins?: string[]; /** * This is a list of Babel presets that will be used when transforming * worklets' code with Worklets Babel Plugin. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#extrapresets} * * - Defaults to an empty array `[]`. */ extraPresets?: string[]; /** * This is a list of identifiers (objects) that will not be copied to the UI * thread if a worklet requires them. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#globals} * * - Defaults to an empty array `[]`. */ globals?: string[]; /** * _EXPERIMENTAL_ * * This options enables compilation of worklets to Hermes bytecode. The * compilation is used only for production builds. * * This setting applies only to Legacy Eval Mode and has no effect on Bundle * Mode. */ hermesBytecode?: boolean; /** * _EXPERIMENTAL_ * * This option is required to specify the path to the Hermes bytecode * compiler binary. It is used only when `hermesBytecode` is enabled. */ getHBCBinary?: () => string; /** Temporary internal option to create ShareableUnpacker. */ limitInitDataHoisting?: boolean; /** * This option comes in handy for Web apps. Because Babel ordinarily doesn't * get information about the target platform, it includes worklet data in * the bundle that only Native apps find relevant. If you enable this * option, your bundle size will be smaller. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#omitnativeonlydata} * * - Defaults to `false`. */ omitNativeOnlyData?: boolean; /** * This option dictates the passed file location for a worklet's source map. * If you enable this option, the file paths will be relative to * `process.cwd` (the current directory where Babel executes). This can be * handy for Jest test snapshots to ensure consistent results across * machines. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#relativesourcelocation} * * - Defaults to `false`. */ relativeSourceLocation?: boolean; /** * Turns off the warning that the plugin prints in Bundle Mode when an * `importForwarding.relativePaths` entry has only common folder names, such * as `'src'` or `'app/src'`. Such a path can also match folders inside * packages in `node_modules`. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#silencedangerouspathswarning} * * - Defaults to `false`. */ silenceDangerousPathsWarning?: boolean; /** * This option makes it so no global identifiers are implicitly captured in * worklets' closures between runtimes. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#strictglobal} * * Defaults to `false`. */ strictGlobal?: boolean; /** * This option can also be useful for Web apps. In Reanimated, there are * numerous checks to determine the right function implementation for a * specific target platform. Enabling this option changes all the checks * that identify if the target is a Web app to `true`. This alteration can * aid in tree-shaking and contribute to reducing the bundle size. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#substitutewebplatformchecks} * * - Defaults to `false`. */ substituteWebPlatformChecks?: boolean; /** * Configures [import * forwarding](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/importForwarding/) * for the Bundle Mode. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#importforwarding} */ importForwarding?: { /** * Modules in this list are forwarded as imports inside worklets. * * The module name has to be an exact match. With `'my-library'` in the * list, imports from `'my-library/some-file'` aren't forwarded. Add * `'my-library/some-file'` to the list to forward them too. * * Only named and default imports are forwarded. Namespace imports such * as `import * as lib from 'my-library'` are captured from the closure * instead. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#importforwardingmodulenames} * * - Defaults to an empty array `[]`. */ moduleNames?: string[]; /** * List of paths used to determine which modules should forward their * relative imports inside worklets. * * If a module's path matches any of the provided paths, all relative * imports inside that module's worklets will be forwarded. * * Use this instead of {@link moduleNames} when you want to forward * relative imports (like `'./utils'`) from a specific package, without * affecting identically-named relative imports in other packages. * * A path matches a sequence of whole path segments (folder names and * the file name) anywhere in the module's path. For a module in * `node_modules`, only the part after the last `node_modules` is * compared. A common name such as `'src'` therefore also matches * packages with a `src` folder, for example * `react-native-reanimated/src`. Use a sequence of segments that only * your code has, and check that it does not occur in the paths of your * dependencies. * * {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-plugin/plugin-options/#importforwardingrelativepaths} * * - Defaults to an empty array `[]`. */ relativePaths?: string[]; }; }