mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-24 17:18:09 +00:00
Make compatible with webpack (#244)
This commit is contained in:
parent
752d876994
commit
1247806f9b
2
.babelrc
2
.babelrc
@ -21,7 +21,7 @@
|
|||||||
"transform-flow-strip-types",
|
"transform-flow-strip-types",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// For publishing to NPM for RN
|
// For publishing to NPM for web
|
||||||
"publish-web": {
|
"publish-web": {
|
||||||
"presets": ["es2015", "stage-1", "react"],
|
"presets": ["es2015", "stage-1", "react"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"react-native-v1": "lib-rn/react-navigation.js",
|
"react-native-v1": "lib-rn/react-navigation.js",
|
||||||
"web": "lib/react-navigation.web.js"
|
"web": "lib/react-navigation.web.js"
|
||||||
},
|
},
|
||||||
|
"module": "lib/react-navigation.web.js",
|
||||||
"webpack": "lib/react-navigation.web.js",
|
"webpack": "lib/react-navigation.web.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "git@github.com:react-community/react-navigation.git",
|
"url": "git@github.com:react-community/react-navigation.git",
|
||||||
|
11
src/PlatformHelpers.js
Normal file
11
src/PlatformHelpers.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* @flow */
|
||||||
|
|
||||||
|
export const Linking = {
|
||||||
|
addEventListener: () => {},
|
||||||
|
removeEventListener: () => {},
|
||||||
|
getInitialURL: () => Promise.reject('Unsupported platform'),
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BackAndroid = {
|
||||||
|
addEventListener: () => {},
|
||||||
|
};
|
12
src/PlatformHelpers.native.js
Normal file
12
src/PlatformHelpers.native.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import {
|
||||||
|
BackAndroid,
|
||||||
|
Linking,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
|
export {
|
||||||
|
BackAndroid,
|
||||||
|
Linking,
|
||||||
|
};
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import invariant from 'fbjs/lib/invariant';
|
||||||
import {
|
import {
|
||||||
BackAndroid,
|
BackAndroid,
|
||||||
Linking,
|
Linking,
|
||||||
} from 'react-native';
|
} from './PlatformHelpers';
|
||||||
import invariant from 'fbjs/lib/invariant';
|
|
||||||
import NavigationActions from './NavigationActions';
|
import NavigationActions from './NavigationActions';
|
||||||
import addNavigationHelpers from './addNavigationHelpers';
|
import addNavigationHelpers from './addNavigationHelpers';
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ module.exports = {
|
|||||||
// Core
|
// Core
|
||||||
get createNavigationContainer() { return require('./createNavigationContainer').default; },
|
get createNavigationContainer() { return require('./createNavigationContainer').default; },
|
||||||
get StateUtils() { return require('./StateUtils').default; },
|
get StateUtils() { return require('./StateUtils').default; },
|
||||||
get PropTypes() { return require('./PropTypes').default; },
|
|
||||||
get addNavigationHelpers() { return require('./addNavigationHelpers').default; },
|
get addNavigationHelpers() { return require('./addNavigationHelpers').default; },
|
||||||
get NavigationActions() { return require('./NavigationActions').default; },
|
get NavigationActions() { return require('./NavigationActions').default; },
|
||||||
|
|
||||||
|
@ -78,9 +78,6 @@ module.exports = {
|
|||||||
// https://github.com/facebookincubator/create-react-app/issues/290
|
// https://github.com/facebookincubator/create-react-app/issues/290
|
||||||
extensions: ['.js', '.json', '.jsx', ''],
|
extensions: ['.js', '.json', '.jsx', ''],
|
||||||
alias: {
|
alias: {
|
||||||
// Support React Native Web
|
|
||||||
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
|
|
||||||
'react-native': 'react-native-web',
|
|
||||||
'react-navigation': path.resolve(__dirname, '../../'),
|
'react-navigation': path.resolve(__dirname, '../../'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -81,9 +81,6 @@ module.exports = {
|
|||||||
// https://github.com/facebookincubator/create-react-app/issues/290
|
// https://github.com/facebookincubator/create-react-app/issues/290
|
||||||
extensions: ['.js', '.json', '.jsx', ''],
|
extensions: ['.js', '.json', '.jsx', ''],
|
||||||
alias: {
|
alias: {
|
||||||
// Support React Native Web
|
|
||||||
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
|
|
||||||
'react-native': 'react-native-web',
|
|
||||||
'react-navigation': path.resolve(__dirname, '../../'),
|
'react-navigation': path.resolve(__dirname, '../../'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
"react-addons-css-transition-group": "~15.3.2",
|
"react-addons-css-transition-group": "~15.3.2",
|
||||||
"react-dom": "~15.3.2",
|
"react-dom": "~15.3.2",
|
||||||
"react-markdown": "^2.4.2",
|
"react-markdown": "^2.4.2",
|
||||||
"react-native-web": "^0.0.55",
|
|
||||||
"react-navigation": "^0.0.0",
|
"react-navigation": "^0.0.0",
|
||||||
"slugify": "^1.1.0"
|
"slugify": "^1.1.0"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user