Skip to content

Instantly share code, notes, and snippets.

@mp5maker
Created December 20, 2020 10:04
Show Gist options
  • Save mp5maker/9eed229111f705225c76bef497ea6f4d to your computer and use it in GitHub Desktop.
Save mp5maker/9eed229111f705225c76bef497ea6f4d to your computer and use it in GitHub Desktop.
Expo App (Metro Configuration for sharing code with the web app)
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