forked from rainbow-me/rainbow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metro.transform.js
29 lines (28 loc) · 900 Bytes
/
metro.transform.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* eslint-disable import/no-commonjs */
const { merge } = require('lodash');
const { transform } = require('metro-plugin-anisotropic-transform');
module.exports.transform = function applyRainbowTransform({
src,
filename,
options,
}) {
const opts = merge(options, {
customTransformOptions: {
'metro-plugin-anisotropic-transform': {
cyclicDependents: /.+\/node_modules\/react-native\/Libraries\/BatchedBridge\/NativeModules\.js$/,
globalScopeFilter: {
'@react-native-community/clipboard': {},
'react-native-keychain': {},
'react-native-video': {},
'react-native-webview': {
exceptions: ['@ratio.me/ratio-react-native-library'],
},
},
madge: {
tsConfig: require.resolve('./tsconfig.json'),
},
},
},
});
return transform({ filename, options: opts, src });
};