mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
31 lines
758 B
JavaScript
31 lines
758 B
JavaScript
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
const packages = path.resolve(__dirname, '..', '..', 'packages');
|
|
|
|
const alias = Object.fromEntries(
|
|
fs
|
|
.readdirSync(packages)
|
|
.filter((name) => !name.startsWith('.'))
|
|
.map((name) => [name, require(`../../packages/${name}/package.json`)])
|
|
.filter(([, pak]) => pak.source != null)
|
|
.map(([name, pak]) => [pak.name, path.resolve(packages, name, pak.source)])
|
|
);
|
|
|
|
module.exports = {
|
|
presets: ['module:metro-react-native-babel-preset'],
|
|
plugins: [
|
|
[
|
|
'module-resolver',
|
|
{
|
|
root: ['..'],
|
|
extensions: ['.tsx', '.ts', '.js', '.json'],
|
|
alias: {
|
|
'react-native': 'react-native-web',
|
|
...alias,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
};
|