yarn add --dev babel-plugin-module-resolver
{ "extends": "expo/tsconfig.base", "compilerOptions": { "strict": true, "baseUrl": ".", "paths": { "@App/*": [ "./src/app/*" ], "@Domain/*": [ "./src/domain/*" ], "@Framework/*": [ "./src/framework/*" ], "@Ui/*": [ "./src/ui/*" ] } } }
const tsconfig = require('./tsconfig.json'); let rawAlias = tsconfig.compilerOptions.paths; let alias = {}; for (let x in rawAlias) { alias[x.replace('/*', '')] = rawAlias[x].map( p => p.replace('/*', '')); } module.exports = function(api) { api.cache(true); return { presets: ['babel-preset-expo'], plugins: [ [ 'module-resolver', { root: ['./'], extensions: [ '.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json', ], alias, }, ], ], }; };
expo, react native, typescript — Jun 8, 2021