How to include files outside project root from a common folder? #1835
-
I have a repo with this structure:
I'm trying to import the shared json file into RN but the metro bundler can't include files outside the project from what I've read. Apparently I am supposed to put a //this is for allow importing of common folder outside root
const path = require('path');
const COMMON_PATH = path.resolve(path.join(__dirname, '../common'));
const extraNodeModules = {
'common': COMMON_PATH,
};
const watchFolders = [
COMMON_PATH
];
/////////////////////////////
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver: {
extraNodeModules
},
watchFolders,
}; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've had nothing but problems trying to do this, myself. If someone "solves" it, that would be epic. You might even hardlink the folder into your app. That might work.
|
Beta Was this translation helpful? Give feedback.
I've had nothing but problems trying to do this, myself. If someone "solves" it, that would be epic.
You might even hardlink the folder into your app. That might work.