Read the paths information defined in tsconfig.json and make it usable in babel-plugin-module-resolver.
yarn add -D babel-plugin-module-resolver load-ts-paths
babel.config.js
const {loadTsPaths} = require('load-ts-paths')
module.exports = {
presets: [...],
plugins: [
[
'babel-plugin-module-resolver',
{
root: ['./src'], // baseUrl of tsconfig.json
alias: loadTsPaths('./tsconfig.json'),
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
],
}