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

PluginReactLynxOptions.enableRemoveCSSScope property

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.

Signature:

enableRemoveCSSScope?: boolean | undefined;
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.