mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-12 22:30:36 +08:00
<img width="740" alt="Screen Shot 2020-05-20 at 16 31 30" src="https://user-images.githubusercontent.com/1174278/82458770-673d8880-9ab7-11ea-81d3-8ac0c1e52705.png">
41 lines
811 B
JavaScript
41 lines
811 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) => [
|
|
`@react-navigation/${name}`,
|
|
path.resolve(
|
|
packages,
|
|
name,
|
|
require(`../../packages/${name}/package.json`).source
|
|
),
|
|
])
|
|
);
|
|
|
|
module.exports = {
|
|
presets: [
|
|
'@babel/preset-env',
|
|
'@babel/preset-flow',
|
|
'@babel/preset-typescript',
|
|
'@babel/preset-react',
|
|
],
|
|
plugins: [
|
|
'@babel/plugin-proposal-class-properties',
|
|
[
|
|
'module-resolver',
|
|
{
|
|
root: ['..'],
|
|
alias: {
|
|
'react-native': 'react-native-web',
|
|
...alias,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
};
|