Skip to content

Commit 106621e

Browse files
committed
fix: update module resolver alias to correctly map source directory for subpath imports
1 parent 6701d84 commit 106621e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

example/babel.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ module.exports = (api) => {
1111
{
1212
extensions: ['.js', '.ts', '.json', '.jsx', '.tsx'],
1313
alias: {
14-
[pak.name]: path.join(__dirname, '../', pak.source),
14+
// Map to the source directory (not `src/index`) so that subpath
15+
// imports like `react-native-sensitive-info/hooks` resolve to
16+
// `src/hooks/index.ts` instead of `src/index/hooks`.
17+
[pak.name]: path.join(__dirname, '..', 'src'),
1518
},
1619
},
1720
],

0 commit comments

Comments
 (0)