Permalink
Browse files

`react-web bundle` worked well

  • Loading branch information...
1 parent 21c4a20 commit 601b6af30ec1fd000e7347a8916d8add246aaf2d @flyskywhy flyskywhy committed Aug 15, 2016
View
@@ -0,0 +1,2 @@
+/node_modules/
+/web/output/
View
@@ -28,6 +28,10 @@ project.xcworkspace
.gradle
local.properties
+# Web
+#
+/web/output/
+
# node.js
#
node_modules/
View
@@ -17,6 +17,7 @@ For local development you need to follow the below commands:
```
git clone https://github.com/soliury/noder-react-native.git
npm install
+./post_npm_install.sh
```
View
@@ -0,0 +1,13 @@
+import React from 'react';
+import {AppRegistry} from 'react-native';
+import Noder from './src';
+
+
+AppRegistry.registerComponent('noder', () => Noder);
+
+var app = document.createElement('div');
+document.body.appendChild(app);
+
+AppRegistry.runApplication('noder', {
+ rootTag: app
+});
View
@@ -53,6 +53,7 @@
"dev-ip": "^1.0.1",
"eslint": "^2.13.1",
"eslint-plugin-react": "^5.2.2",
+ "file-loader": "^0.9.0",
"gulp": "^3.9.1",
"gulp-replace": "^0.5.4",
"gulp-util": "^3.0.4",
@@ -62,6 +63,7 @@
"react-native-cli": "^0.2.0",
"redux-devtools": "^3.3.1",
"run-sequence": "^1.2.1",
+ "url-loader": "^0.5.7",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1",
"webpack-html-plugin": "^0.1.1"
View
@@ -0,0 +1,10 @@
+#!/bin/bash
+# patch some node_modules to build well
+
+if [ ! -d node_modules ]; then
+ npm install
+fi
+
+# react-web can't recognize *.android.js and *.ios.js now, so be it
+cp post_npm_install/react-native-blur/src/* node_modules/react-native-blur/src/
+cp post_npm_install/react-native-scrollable-tab-view/Button.js node_modules/react-native-scrollable-tab-view/
@@ -0,0 +1,3 @@
+import {Platform} from 'react-native';
+
+module.exports = Platform.OS === 'web' ? require('./BlurView.ios') : require('./BlurView.' + Platform.OS);
@@ -0,0 +1,3 @@
+import {Platform} from 'react-native';
+
+module.exports = Platform.OS === 'web' ? require('./VibrancyView.ios') : require('./VibrancyView.' + Platform.OS);
@@ -0,0 +1,3 @@
+import {Platform} from 'react-native';
+
+module.exports = Platform.OS === 'web' ? require('./Button.ios') : require('./Button.' + Platform.OS);
@@ -16,7 +16,7 @@ let isProd = NODE_ENV === 'production';
var config = {
paths: {
src: path.join(ROOT_PATH, '.'),
- index: path.join(ROOT_PATH, 'index.ios'),
+ index: path.join(ROOT_PATH, 'index.web'),
},
};
@@ -73,7 +73,10 @@ module.exports = {
presets: ['es2015', 'react', 'stage-1']
},
include: [config.paths.src],
- exclude: [/node_modules/]
+ exclude: [/(node_modules\/(?!react))/, path.join(ROOT_PATH, 'post_npm_install')]
+ }, {
+ test : /\.(png|gif|svg|jpg)$/,
+ loader : 'url-loader?limit=8192'
}]
}
};

0 comments on commit 601b6af

Please sign in to comment.