ソースを参照

Prepare for React: Use Haste resolver for Web

In preparation for and as another early step in rewriting the Web
version of jitsi-meet using React, use Haste resolver which is able to
distinguish among platform-independent files, Web-specific and
mobile-specific ones.

Additionally, (1) make sure that Babel is capable of understanding React
files and (2) introduce React as a dependency.

The purpose is to repeatedly take small steps towards our goal and merge
them before they get in conflict with the separate ongoing advancement
of the Web version of jitsi-meet.
master
Ilya Daynatovich 8年前
コミット
766eb94c7d
2個のファイルの変更18行の追加7行の削除
  1. 8
    4
      package.json
  2. 10
    3
      webpack.config.js

+ 8
- 4
package.json ファイルの表示

@@ -21,19 +21,21 @@
21 21
     "autosize": "^1.18.13",
22 22
     "bootstrap": "3.1.1",
23 23
     "events": "*",
24
+    "haste-resolver-webpack-plugin": "^0.2.2",
24 25
     "i18next": "3.4.4",
25 26
     "i18next-xhr-backend": "1.1.0",
26
-    "jquery-i18next": "1.1.0",
27
-    "json-loader": "0.5.4",
28
-    "jQuery-Impromptu": "trentrichardson/jQuery-Impromptu#v6.0.0",
29 27
     "jquery": "~2.1.1",
30 28
     "jquery-contextmenu": "*",
29
+    "jquery-i18next": "1.1.0",
30
+    "jQuery-Impromptu": "trentrichardson/jQuery-Impromptu#v6.0.0",
31 31
     "jquery-ui": "1.10.5",
32
+    "json-loader": "0.5.4",
32 33
     "jssha": "1.5.0",
33 34
     "jws": "*",
34 35
     "lib-jitsi-meet": "jitsi/lib-jitsi-meet",
35 36
     "postis": "^2.2.0",
36 37
     "react": "15.3.2",
38
+    "react-dom": "15.3.2",
37 39
     "react-native": "0.37.0",
38 40
     "react-native-vector-icons": "^2.0.3",
39 41
     "react-native-webrtc": "jitsi/react-native-webrtc",
@@ -49,9 +51,11 @@
49 51
   },
50 52
   "devDependencies": {
51 53
     "babel-core": "*",
52
-    "babel-loader": "*",
54
+    "babel-loader": "^6.2.8",
53 55
     "babel-polyfill": "*",
54 56
     "babel-preset-es2015": "6.14.0",
57
+    "babel-preset-react": "^6.16.0",
58
+    "babel-preset-stage-1": "^6.16.0",
55 59
     "clean-css": "*",
56 60
     "css-loader": "*",
57 61
     "eslint": ">=3",

+ 10
- 3
webpack.config.js ファイルの表示

@@ -2,6 +2,7 @@
2 2
 
3 3
 require('babel-polyfill'); // Define Object.assign() from ES6 in ES5.
4 4
 
5
+var HasteResolverPlugin = require('haste-resolver-webpack-plugin');
5 6
 var process = require('process');
6 7
 
7 8
 var aui_css = __dirname + '/node_modules/@atlassian/aui/dist/aui/css/';
@@ -16,16 +17,19 @@ var config = {
16 17
     devtool: 'source-map',
17 18
     module: {
18 19
         loaders: [{
19
-            // Transpile ES2015 (aka ES6) to ES5.
20
+            // Transpile ES2015 (aka ES6) to ES5. Accept the JSX syntax by React
21
+            // as well.
20 22
 
21 23
             exclude: __dirname + '/node_modules/',
22 24
             loader: 'babel',
23 25
             query: {
24 26
                 presets: [
25
-                    'es2015'
27
+                    'es2015',
28
+                    'react',
29
+                    'stage-1'
26 30
                 ]
27 31
             },
28
-            test: /\.js$/
32
+            test: /\.jsx?$/
29 33
         },{
30 34
             // Expose jquery as the globals $ and jQuery because it is expected
31 35
             // to be available in such a form by multiple jitsi-meet
@@ -83,6 +87,9 @@ var config = {
83 87
         path: __dirname + '/build',
84 88
         sourceMapFilename: '[name].' + (minimize ? 'min' : 'js') + '.map'
85 89
     },
90
+    plugins: [
91
+        new HasteResolverPlugin()
92
+    ],
86 93
     resolve: {
87 94
         alias: {
88 95
             aui:

読み込み中…
キャンセル
保存