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
This commit is contained in:
parent
ea0e9e68e7
commit
4522841f8a
30
examples/basic/metro.config.js
Normal file
30
examples/basic/metro.config.js
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 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/mlkit/.*`),
|
||||
new RegExp(`${reactNativeCameraRoot}/node_modules/react-native/.*`),
|
||||
new RegExp(
|
||||
`${reactNativeCameraRoot}/examples/advanced/advanced/node_modules/react-native/.*`,
|
||||
),
|
||||
]),
|
||||
},
|
||||
};
|
||||
30
examples/mlkit/metro.config.js
Normal file
30
examples/mlkit/metro.config.js
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 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/.*`,
|
||||
),
|
||||
]),
|
||||
},
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user