File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
compiler/packages/babel-plugin-react-compiler/src Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ export default function BabelPluginReactCompiler(
3030 */
3131 Program ( prog , pass ) : void {
3232 let opts = parsePluginOptions ( pass . opts ) ;
33- if ( pipelineUsesReanimatedPlugin ( pass . file . opts . plugins ) ) {
33+ if (
34+ opts . disableCheckForSupportedLibraries !== false &&
35+ pipelineUsesReanimatedPlugin ( pass . file . opts . plugins )
36+ ) {
3437 opts = injectReanimatedFlag ( opts ) ;
3538 }
3639 if ( process . env [ "NODE_ENV" ] === "development" ) {
Original file line number Diff line number Diff line change @@ -111,6 +111,13 @@ export type PluginOptions = {
111111 ignoreUseNoForget : boolean ;
112112
113113 sources ?: Array < string > | ( ( filename : string ) => boolean ) | null ;
114+
115+ /**
116+ * The compiler has customized support for some popular React libraries (to provide even more optimized output).
117+ * By default the compiler checks for the presence of these libraries via a `try { require(...) }` call. Set this
118+ * flag to disable the automatic check.
119+ */
120+ disableCheckForSupportedLibraries ?: boolean ;
114121} ;
115122
116123const CompilationModeSchema = z . enum ( [
You can’t perform that action at this time.
0 commit comments