Created
December 20, 2020 10:04
-
-
Save mp5maker/9eed229111f705225c76bef497ea6f4d to your computer and use it in GitHub Desktop.
Expo App (Metro Configuration for sharing code with the web app)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const extraNodeModules = { | |
"@web": path.join(__dirname, "..", "weba-app/src"), | |
}; | |
const watchFolders = [path.join(__dirname, "..", "web-app/src")]; | |
module.exports = { | |
transformer: { | |
getTransformOptions: async () => ({ | |
transform: { | |
experimentalImportSupport: false, | |
inlineRequires: false, | |
}, | |
}), | |
}, | |
resolver: { | |
extraNodeModules: new Proxy(extraNodeModules, { | |
get: (target, name) => { | |
return name in target | |
? target[name] | |
: path.join(process.cwd(), `node_modules/${name}`) | |
} | |
}), | |
}, | |
watchFolders | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment