2018-03-30 16:09:32 +00:00
|
|
|
const { resolve } = require('path');
|
|
|
|
|
2018-03-23 13:40:07 +00:00
|
|
|
let metroBundler;
|
|
|
|
try {
|
|
|
|
metroBundler = require('metro');
|
|
|
|
} catch (ex) {
|
|
|
|
metroBundler = require('metro-bundler');
|
|
|
|
}
|
|
|
|
|
2018-03-30 16:09:32 +00:00
|
|
|
const blacklist = metroBundler.createBlacklist;
|
|
|
|
|
2018-03-23 13:40:07 +00:00
|
|
|
module.exports = {
|
2018-03-30 16:09:32 +00:00
|
|
|
getProjectRoots() {
|
|
|
|
return [__dirname, resolve(__dirname, '..')];
|
|
|
|
},
|
|
|
|
getProvidesModuleNodeModules() {
|
|
|
|
return ['react-native', 'react', 'prop-types', 'fbjs'];
|
|
|
|
},
|
|
|
|
getBlacklistRE() {
|
|
|
|
return blacklist([
|
|
|
|
new RegExp(`^${escape(resolve(__dirname, '..', 'node_modules'))}\\/.*$`),
|
|
|
|
new RegExp(`^${escape(resolve(__dirname, '..', 'tests'))}\\/.*$`),
|
|
|
|
new RegExp(
|
|
|
|
`^${escape(resolve(__dirname, '..', 'tests', 'node_modules'))}\\/.*$`
|
|
|
|
),
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
};
|