This is the dev preview website. Check out the document at lynxjs.org

Home > @lynx-js/react-rsbuild-plugin > PluginReactLynxOptions

PluginReactLynxOptions interface

Options of pluginReactLynx()

Signature:

export interface PluginReactLynxOptions 

Properties

Property

Modifiers

Type

Description

compat?

Partial<CompatVisitorConfig> & { disableCreateSelectorQueryIncompatibleWarning?: boolean; } | undefined

(Optional) The compat option controls compatibilities with ReactLynx2.0.

customCSSInheritanceList?

string[] | undefined

(Optional) When PluginReactLynxOptions.enableCSSInheritance is enabled, customCSSInheritanceList can control which properties are inheritable, not just the default ones.

debugInfoOutside?

boolean

(Optional) debugInfoOutside controls whether the debug info is placed outside the template.

defaultDisplayLinear?

boolean

(Optional) defaultDisplayLinear controls whether the default value of display in CSS is linear.

If defaultDisplayLinear === false, the default display would be flex instead of linear.

defineDCE?

Partial<DefineDceVisitorConfig> | undefined

(Optional) Like define in various bundlers, but this one happens at transform time, and a DCE pass will be performed.

enableAccessibilityElement?

boolean

(Optional) enableAccessibilityElement set the default value of accessibility-element for all <view /> elements.

enableCSSInheritance?

boolean

(Optional) enableCSSInheritance enables the default inheritance properties.

enableCSSInvalidation?

boolean

(Optional) CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the DOM is updated.

enableCSSSelector?

boolean

(Optional) enableCSSSelector controls whether enabling the new CSS implementation.

enableNewGesture?

boolean

(Optional) enableNewGesture enables the new gesture system.

enableRemoveCSSScope?

boolean | undefined

(Optional) enableRemoveCSSScope controls whether CSS is restrict to use in the component scope.

true: All CSS files are treated as global CSS.

false: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it.

undefined: Only use scoped CSS for CSS Modules, and treat other CSS files as global CSS. Scoped CSS is faster than global CSS, thus you can use CSS Modules to speedy up your CSS if there are performance issues.

enableSSR?

boolean

(Optional) enableSSR enable Lynx SSR feature for this build.

enableUiSourceMap?

boolean

(Optional) Enable UI source map generation and debug-metadata asset emission.

engineVersion?

string

(Optional) engineVersion specifies the minimum Lynx Engine version required for an App bundle to function properly.

experimental_isLazyBundle?

boolean

(ALPHA) (Optional) Generate standalone lazy bundle.

extractStr?

Partial<ExtractStrConfig> | boolean

(Optional) Merge same string literals in JS and Lepus to reduce output bundle size. Set to false to disable.

firstScreenSyncTiming?

'immediately' | 'jsReady'

(Optional) This flag controls when MainThread (Lepus) transfers control to Background after the first screen

This flag has two options:

"immediately": Transfer immediately

"jsReady": Transfer when background (JS Runtime) is ready

After handing over control, MainThread (Lepus) runtime can no longer respond to data updates, and data updates will be forwarded to background (JS Runtime) and processed __asynchronously__

globalPropsMode?

'reactive' | 'event'

(Optional) Configure the update mode of lynx.__globalProps.

This flag has two options:

'reactive': UpdateGlobalProps will trigger update automatically.

'event': UpdateGlobalProps will trigger global event and users need to trigger update in the event handler.

optimizeBundleSize?

boolean | { mainThread?: boolean; background?: boolean; }

(Optional) Optimize bundle size by removing unused code by Minify.mainThreadOptions and Minify.backgroundOptions.

When optimizeBundleSize or optimizeBundleSize.mainThread is true, main-thread code will be optimized. When optimizeBundleSize or optimizeBundleSize.background is true, background code will be optimized.

removeDescendantSelectorScope?

boolean

(Optional) removeDescendantSelectorScope is used to remove the scope of descendant selectors.

shake?

Partial<ShakeVisitorConfig> | undefined

(Optional) How main-thread code will be shaken.

targetSdkVersion?

string

(Optional) targetSdkVersion is used to specify the minimal Lynx Engine version that a App bundle can run on.