From 4f4aaf9a0271416457e27993e8a1bbde07107634 Mon Sep 17 00:00:00 2001 From: skovhus Date: Fri, 6 Oct 2017 14:38:36 +0200 Subject: [PATCH] Fix example failing with "Unable to resolve module react" --- Example/rn-cli.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Example/rn-cli.config.js diff --git a/Example/rn-cli.config.js b/Example/rn-cli.config.js new file mode 100644 index 0000000..b767448 --- /dev/null +++ b/Example/rn-cli.config.js @@ -0,0 +1,12 @@ +const path = require('path'); + +// As the metro bundler does not support linking correctly, we add additional +// search path queries to all modules. +// See https://github.com/facebook/metro-bundler/issues/68 +const extraNodeModulesGetter = { + get: (target, name) => path.join(process.cwd(), `node_modules/${name}`), +}; + +module.exports = { + extraNodeModules: new Proxy({}, extraNodeModulesGetter), +};