Skip to content

Commit

Permalink
Moved named groups transform plugin to extra plugins when using hermes
Browse files Browse the repository at this point in the history
  • Loading branch information
danilobuerger committed Mar 16, 2022
1 parent eee13bd commit 6ee77ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/metro-react-native-babel-preset/src/configs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const defaultPlugins = [
[require('@babel/plugin-syntax-dynamic-import')],
[require('@babel/plugin-syntax-export-default-from')],
...passthroughSyntaxPlugins,
[require('@babel/plugin-transform-named-capturing-groups-regex')],
[require('@babel/plugin-transform-unicode-regex')],
];

Expand Down Expand Up @@ -92,6 +91,8 @@ const getPreset = (src, options) => {
extraPlugins.push([require('@babel/plugin-transform-function-name')]);
extraPlugins.push([require('@babel/plugin-transform-literals')]);
extraPlugins.push([require('@babel/plugin-transform-sticky-regex')]);
} else {
extraPlugins.push([require('@babel/plugin-transform-named-capturing-groups-regex')]);
}
if (!isHermesCanary) {
extraPlugins.push([
Expand Down

0 comments on commit 6ee77ba

Please sign in to comment.