Skip to content

Commit 6c14046

Browse files
committed
feat: log warning in reanimated plugin and instruct users what to do
1 parent 7c8233c commit 6c14046

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/plugin-reanimated/src/loader.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,17 @@ export function pitch(
8383
_previousRequest: string,
8484
data: ReanimatedLoaderData
8585
) {
86+
const logger = this.getLogger('RepackReanimatedLoader');
8687
for (const loader of this.loaders) {
8788
// if the babel-swc-loader is found, we skip the reanimated-loader
8889
// since babel-swc-loader is more performant and uses the official
8990
// babel plugin directly
9091
if (loader.path === babelSwcLoader) {
9192
data.skip = true;
93+
logger.warn(
94+
'This plugin should not be used with `@callstack/repack/babel-swc-loader`. ' +
95+
'Instead, add the `react-native-reanimated/plugin` (or `react-native-worklets/plugin`) directly to your `babel.config.js` file in the project root.'
96+
);
9297
}
9398
}
9499
}

0 commit comments

Comments
 (0)