I have two applications that actually use the same code base (inside the src folder), with the exception of several configurations. The current folder structure is as follows:
βββ app1
β βββ android
β βββ index.android.js
β βββ index.ios.js
β βββ ios
β βββ node_modules
β βββ package.json
β βββ src
βββ app2
βββ android
βββ index.android.js
βββ index.ios.js
βββ ios
βββ node_modules
βββ package.json
βββ src
Inside index.android.jsand index.ios.jsI need modules from src / folder, for example.import MainView from './src/mainView';
Thus, I have to maintain the same code base in two different places, which is certainly not ideal. This is why I would like to have a folder structure like this:
βββ app1
β βββ android
β βββ index.android.js
β βββ index.ios.js
β βββ ios
β βββ node_modules
β βββ package.json
βββ app2
β βββ android
β βββ index.android.js
β βββ index.ios.js
β βββ ios
β βββ node_modules
β βββ package.json
βββ src
Unfortunately, the required calls do not correctly resolve the path with this structure. When I use import MainView from '../src/MainView', the following error message appears:

Is there any other way to achieve what I want?