Skip to content

Commit 8685d58

Browse files
committed
fix: Add babel config to expo example for @ alias resolution
1 parent d8dd8d5 commit 8685d58

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

example/expo/babel.config.cjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Don't edit this file directly if you don't have to.
3+
* Modify the babel config file in the project root directory.
4+
*/
5+
const path = require('path');
6+
7+
const appDir = path.resolve(__dirname, '../app');
8+
9+
module.exports = function (api) {
10+
api.cache(true);
11+
return {
12+
presets: ['babel-preset-expo'],
13+
plugins: [
14+
'@babel/plugin-transform-export-namespace-from',
15+
[
16+
'module-resolver',
17+
{
18+
root: ['./'],
19+
extensions: ['.ts', '.tsx', '.svg', '.json'],
20+
// This needs to be mirrored in ../app/tsconfig.json
21+
alias: {
22+
'@': path.join(appDir, 'src')
23+
}
24+
}
25+
],
26+
'react-native-worklets/plugin'
27+
]
28+
};
29+
};

0 commit comments

Comments
 (0)