diff --git a/babel.config.js b/babel.config.js index 6a9418c90892..3b168b7a9409 100644 --- a/babel.config.js +++ b/babel.config.js @@ -5,6 +5,17 @@ module.exports = { plugins: [ 'transform-inline-environment-variables', 'react-native-reanimated/plugin', + [ + 'module-resolver', + { + root: ['.'], + alias: { + '~/app': './app', + '~/locales': './locales', + '~/e2e': './e2e', + }, + }, + ], ], overrides: [ { diff --git a/package.json b/package.json index 55ac7de983e2..5d41e88d3e65 100644 --- a/package.json +++ b/package.json @@ -468,6 +468,7 @@ "babel-jest": "^29.7.0", "babel-loader": "^9.1.3", "babel-plugin-inline-import": "^3.0.0", + "babel-plugin-module-resolver": "^5.0.2", "babel-plugin-transform-inline-environment-variables": "^0.4.4", "babel-plugin-transform-remove-console": "6.9.4", "browserstack-local": "^1.5.1", diff --git a/tsconfig.json b/tsconfig.json index 8f52d56e08ef..c000d92935bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,7 +39,8 @@ "baseUrl": "." /* Base directory to resolve non-absolute module names. */, "paths": { "images/*": ["./app/images/*"], - "@keystonehq/ur-decoder": ["app/declarations/@keystonehq/ur-decoder.ts"] + "@keystonehq/ur-decoder": ["app/declarations/@keystonehq/ur-decoder.ts"], + "~/*": ["*"] } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */, // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ diff --git a/yarn.lock b/yarn.lock index d189acc2bac8..65567832f163 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12399,7 +12399,7 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-module-resolver@^5.0.0: +babel-plugin-module-resolver@^5.0.0, babel-plugin-module-resolver@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-5.0.2.tgz#cdeac5d4aaa3b08dd1ac23ddbf516660ed2d293e" integrity sha512-9KtaCazHee2xc0ibfqsDeamwDps6FZNo5S0Q81dUqEuFzVwPhcT4J5jOqIVvgCA3Q/wO9hKYxN/Ds3tIsp5ygg==