react-native-camera/examples/mlkit/metro.config.js
fabriziobertoglio1987 4522841f8a fix(android): fix bug Duplicate module rn
fixing bug Duplicate module react-native
when running the mlkit and basic examples

1) adding metro.config.js to examples/basic and
examples/mlkit

2) adding new RegExp in blacklist to ignore the
advanced/node_modules/react-native/.* files
2020-03-10 10:12:11 +01:00

31 lines
816 B
JavaScript

/**
* This file overrides metro config so
*/
'use strict';
const path = require('path');
const blacklist = require('metro-config/src/defaults/blacklist');
const reactNativeCameraRoot = path.resolve(__dirname, '..', '..');
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
watchFolders: [path.resolve(__dirname, 'node_modules'), reactNativeCameraRoot],
resolver: {
blacklistRE: blacklist([
new RegExp(`${reactNativeCameraRoot}/examples/basic/.*`),
new RegExp(`${reactNativeCameraRoot}/node_modules/react-native/.*`),
new RegExp(
`${reactNativeCameraRoot}/examples/advanced/advanced/node_modules/react-native/.*`,
),
]),
},
};