mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 04:45:19 +08:00
chore: configure bob and metro
This commit is contained in:
12
packages/core/example/.babelrc
Normal file
12
packages/core/example/.babelrc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
"expo"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
["module-resolver", {
|
||||||
|
"alias": {
|
||||||
|
"@react-navigation/core": "../src/index"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
"sdkVersion": "32.0.0",
|
"sdkVersion": "32.0.0",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"primaryColor": "#2196f3",
|
"primaryColor": "#2196f3",
|
||||||
|
"packagerOpts": {
|
||||||
|
"config": "./metro.config.js",
|
||||||
|
"projectRoots": ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
packages/core/example/metro.config.js
Normal file
35
packages/core/example/metro.config.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/* eslint-disable import/no-extraneous-dependencies, import/no-commonjs */
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const blacklist = require('metro-config/src/defaults/blacklist');
|
||||||
|
const project = require('../package.json');
|
||||||
|
const escape = require('escape-string-regexp');
|
||||||
|
|
||||||
|
const projectDependencies = Object.keys({
|
||||||
|
...project.dependencies,
|
||||||
|
...project.peerDependencies,
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
projectRoot: __dirname,
|
||||||
|
watchFolders: [path.resolve(__dirname, '..')],
|
||||||
|
|
||||||
|
resolver: {
|
||||||
|
blacklistRE: blacklist([
|
||||||
|
new RegExp(
|
||||||
|
`^${escape(
|
||||||
|
path.resolve(__dirname, 'node_modules', project.name)
|
||||||
|
)}\\/.*$`
|
||||||
|
),
|
||||||
|
new RegExp(
|
||||||
|
`^${escape(path.resolve(__dirname, '..', 'node_modules'))}\\/.*$`
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
|
||||||
|
providesModuleNodeModules: [
|
||||||
|
'@expo/vector-icons',
|
||||||
|
'@babel/runtime',
|
||||||
|
...projectDependencies,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -10,25 +10,23 @@
|
|||||||
"postinstall": "rm -rf node_modules/@react-navigation/core/{.git,node_modules,example}"
|
"postinstall": "rm -rf node_modules/@react-navigation/core/{.git,node_modules,example}"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/core": "../",
|
"@react-navigation/native": "^3.4.1",
|
||||||
"@react-navigation/native": "^3.1.4",
|
|
||||||
"expo": "~32.0.0",
|
"expo": "~32.0.0",
|
||||||
"hoist-non-react-statics": "^2.5.0",
|
"hoist-non-react-statics": "^3.3.0",
|
||||||
"prop-types": "^15.6.0",
|
"prop-types": "^15.7.2",
|
||||||
"query-string": "^6.2.0",
|
"query-string": "^6.4.2",
|
||||||
"react": "16.5.0",
|
"react": "16.5.0",
|
||||||
"react-is": "^16.5.2",
|
"react-is": "^16.8.6",
|
||||||
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
|
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
|
||||||
"react-native-paper": "^2.2.8",
|
"react-native-paper": "^2.15.2",
|
||||||
"react-navigation-stack": "^1.0.7",
|
"react-navigation-stack": "^1.3.0",
|
||||||
"react-navigation-tabs": "^1.0.2"
|
"react-navigation-tabs": "^1.0.2"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
|
||||||
"**/react": "16.6.3",
|
|
||||||
"**/prop-types": "15.6.2",
|
|
||||||
"**/hoist-non-react-statics": "2.5.5"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-preset-expo": "^5.0.0"
|
"babel-preset-expo": "^5.1.1"
|
||||||
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"**/react": "16.5.0",
|
||||||
|
"**/hoist-non-react-statics": "3.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,6 @@
|
|||||||
},
|
},
|
||||||
"typeAcquisition": {
|
"typeAcquisition": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"include": ["prop-types", "react", "react-native"]
|
"include": ["react", "react-native"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user