Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map((external: any) => {
if (typeof external !== 'function') {
const relPath = path.join('node_modules', external);
if (!includeFunc(relPath)) return external;
return null;
}
return (ctx: any, req: any, cb: any) => {
const relPath = path.join('node_modules', req);
return includeFunc(relPath) ? cb() : external(ctx, req, cb);
};
})
.filter(Boolean);
}
// Replace JS babel loaders with Expo loaders that can handle RN libraries
const rules = getRulesByMatchingFiles(config, [env.locations.appMain]);
for (const filename of Object.keys(rules)) {
for (const loaderItem of rules[filename]) {
(config.module || { rules: [] }).rules.splice(loaderItem.index, 0, babelConfig);
return config;
}
}
return config;
}