Kaynağa Gözat

Revert "Switch from Browserify to Webpack"

j8
hristoterezov 8 yıl önce
ebeveyn
işleme
c7cd771de2
5 değiştirilmiş dosya ile 114 ekleme ve 173 silme
  1. 0
    8
      .babelrc
  2. 2
    3
      .jshintignore
  3. 37
    24
      Makefile
  4. 75
    19
      package.json
  5. 0
    119
      webpack.config.babel.js

+ 0
- 8
.babelrc Dosyayı Görüntüle

@@ -1,8 +0,0 @@
1
-{
2
-    "plugins": [
3
-        "transform-object-rest-spread"
4
-    ],
5
-    "presets": [
6
-        "es2015"
7
-    ]
8
-}

+ 2
- 3
.jshintignore Dosyayı Görüntüle

@@ -1,5 +1,4 @@
1
-debian
2
-libs
3 1
 node_modules
2
+libs
3
+debian
4 4
 analytics.js
5
-webpack.config.babel.js

+ 37
- 24
Makefile Dosyayı Görüntüle

@@ -1,17 +1,20 @@
1
-BUILD_DIR = build
2
-CLEANCSS = ./node_modules/.bin/cleancss
3
-DEPLOY_DIR = libs
4
-LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet/
5
-NODE_SASS = ./node_modules/.bin/node-sass
6 1
 NPM = npm
7
-OUTPUT_DIR = .
8
-STYLES_BUNDLE = css/all.bundle.css
9
-STYLES_DESTINATION = css/all.css
2
+BROWSERIFY = ./node_modules/.bin/browserify
3
+NODE_SASS = ./node_modules/.bin/node-sass
4
+UGLIFYJS = ./node_modules/.bin/uglifyjs
5
+EXORCIST = ./node_modules/.bin/exorcist
6
+CLEANCSS = ./node_modules/.bin/cleancss
10 7
 STYLES_MAIN = css/main.scss
11 8
 STYLES_UNSUPPORTED_BROWSER = css/unsupported_browser.scss
12
-WEBPACK = ./node_modules/.bin/webpack
9
+STYLES_BUNDLE = css/all.bundle.css
10
+STYLES_DESTINATION = css/all.css
11
+DEPLOY_DIR = libs
12
+BROWSERIFY_FLAGS = -d
13
+OUTPUT_DIR = .
14
+LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet/
15
+IFRAME_API_DIR = ./modules/API/external
13 16
 
14
-all: update-deps compile deploy clean
17
+all: update-deps compile compile-iframe-api uglify uglify-iframe-api deploy clean
15 18
 
16 19
 # FIXME: there is a problem with node-sass not correctly installed (compiled)
17 20
 # a quick fix to make sure it is installed on every update
@@ -20,10 +23,13 @@ update-deps:
20 23
 	$(NPM) update && $(NPM) install node-sass
21 24
 
22 25
 compile:
23
-	$(WEBPACK) -p
26
+	$(BROWSERIFY) $(BROWSERIFY_FLAGS) -e app.js -s APP | $(EXORCIST) $(OUTPUT_DIR)/app.bundle.js.map > $(OUTPUT_DIR)/app.bundle.js
27
+
28
+compile-iframe-api:
29
+	$(BROWSERIFY) $(BROWSERIFY_FLAGS) -e $(IFRAME_API_DIR)/external_api.js -s JitsiMeetExternalAPI | $(EXORCIST) $(OUTPUT_DIR)/external_api.js.map > $(OUTPUT_DIR)/external_api.js
24 30
 
25 31
 clean:
26
-	rm -fr $(BUILD_DIR)
32
+	rm -f $(OUTPUT_DIR)/app.bundle.* $(OUTPUT_DIR)/external_api.*
27 33
 
28 34
 deploy: deploy-init deploy-appbundle deploy-lib-jitsi-meet deploy-css deploy-local
29 35
 
@@ -31,20 +37,20 @@ deploy-init:
31 37
 	mkdir -p $(DEPLOY_DIR)
32 38
 
33 39
 deploy-appbundle:
34
-	cp \
35
-		$(BUILD_DIR)/app.bundle.min.js \
36
-		$(BUILD_DIR)/app.bundle.min.map \
37
-		$(BUILD_DIR)/external_api.min.js \
38
-		$(BUILD_DIR)/external_api.min.map \
39
-		$(OUTPUT_DIR)/analytics.js \
40
-		$(DEPLOY_DIR)
40
+	cp $(OUTPUT_DIR)/app.bundle.min.js $(OUTPUT_DIR)/app.bundle.min.map \
41
+	$(OUTPUT_DIR)/app.bundle.js $(OUTPUT_DIR)/app.bundle.js.map \
42
+	$(OUTPUT_DIR)/external_api.js.map $(OUTPUT_DIR)/external_api.js \
43
+	$(OUTPUT_DIR)/external_api.min.map $(OUTPUT_DIR)/external_api.min.js \
44
+	$(OUTPUT_DIR)/analytics.js \
45
+	$(DEPLOY_DIR)
41 46
 
42 47
 deploy-lib-jitsi-meet:
43
-	cp \
44
-		$(LIBJITSIMEET_DIR)/lib-jitsi-meet.min.js \
45
-		$(LIBJITSIMEET_DIR)/lib-jitsi-meet.min.map \
46
-		$(LIBJITSIMEET_DIR)/connection_optimization/external_connect.js \
47
-		$(DEPLOY_DIR)
48
+	cp $(LIBJITSIMEET_DIR)/lib-jitsi-meet.min.js \
49
+	$(LIBJITSIMEET_DIR)/lib-jitsi-meet.min.map \
50
+	$(LIBJITSIMEET_DIR)/lib-jitsi-meet.js \
51
+	$(LIBJITSIMEET_DIR)/lib-jitsi-meet.js.map \
52
+	$(LIBJITSIMEET_DIR)/connection_optimization/external_connect.js \
53
+	$(DEPLOY_DIR)
48 54
 
49 55
 deploy-css:
50 56
 	$(NODE_SASS) css/unsupported_browser.scss css/unsupported_browser.css ; \
@@ -55,6 +61,13 @@ deploy-css:
55 61
 deploy-local:
56 62
 	([ ! -x deploy-local.sh ] || ./deploy-local.sh)
57 63
 
64
+uglify:
65
+	$(UGLIFYJS) -p relative $(OUTPUT_DIR)/app.bundle.js -o $(OUTPUT_DIR)/app.bundle.min.js --source-map $(OUTPUT_DIR)/app.bundle.min.map --in-source-map $(OUTPUT_DIR)/app.bundle.js.map
66
+
67
+uglify-iframe-api:
68
+	$(UGLIFYJS) -p relative $(OUTPUT_DIR)/external_api.js -o $(OUTPUT_DIR)/external_api.min.js --source-map $(OUTPUT_DIR)/external_api.min.map --in-source-map $(OUTPUT_DIR)/external_api.js.map
69
+
70
+
58 71
 source-package:
59 72
 	mkdir -p source_package/jitsi-meet/css && \
60 73
 	cp -r *.js *.html connection_optimization favicon.ico fonts images libs sounds LICENSE lang source_package/jitsi-meet && \

+ 75
- 19
package.json Dosyayı Görüntüle

@@ -22,13 +22,13 @@
22 22
     "bootstrap": "3.1.1",
23 23
     "events": "*",
24 24
     "i18next-client": "1.7.7",
25
-    "jQuery-Impromptu": "trentrichardson/jQuery-Impromptu#v6.0.0",
25
+    "jQuery-Impromptu": "git+https://github.com/trentrichardson/jQuery-Impromptu.git#v6.0.0",
26 26
     "jquery": "~2.1.1",
27 27
     "jquery-contextmenu": "*",
28 28
     "jquery-ui": "1.10.5",
29 29
     "jssha": "1.5.0",
30 30
     "jws": "*",
31
-    "lib-jitsi-meet": "jitsi/lib-jitsi-meet",
31
+    "lib-jitsi-meet": "git+https://github.com/jitsi/lib-jitsi-meet.git",
32 32
     "postis": "^2.2.0",
33 33
     "retry": "0.6.1",
34 34
     "strophe": "^1.2.2",
@@ -36,39 +36,95 @@
36 36
     "toastr": "^2.0.3"
37 37
   },
38 38
   "devDependencies": {
39
-    "babel-core": "*",
40
-    "babel-loader": "*",
41
-    "babel-plugin-transform-object-rest-spread": "*",
42 39
     "babel-polyfill": "*",
43 40
     "babel-preset-es2015": "*",
44
-    "babel-register": "*",
41
+    "babelify": "*",
42
+    "browserify": "11.1.x",
43
+    "browserify-css": "^0.9.2",
44
+    "browserify-shim": "^3.8.10",
45 45
     "clean-css": "*",
46
-    "css-loader": "*",
47
-    "expose-loader": "*",
48
-    "file-loader": "*",
49
-    "imports-loader": "*",
46
+    "exorcist": "*",
50 47
     "jshint": "2.8.0",
51 48
     "node-sass": "^3.8.0",
52 49
     "precommit-hook": "3.0.0",
53
-    "string-replace-loader": "*",
54
-    "style-loader": "*",
55
-    "webpack": "*"
50
+    "uglify-js": "2.4.24"
56 51
   },
57 52
   "license": "Apache-2.0",
58 53
   "scripts": {
59
-    "lint": "jshint .",
54
+    "lint": "./node_modules/.bin/jshint .",
60 55
     "validate": "npm ls"
61 56
   },
62 57
   "pre-commit": [
63 58
     "lint"
64 59
   ],
60
+  "browserify": {
61
+    "transform": [
62
+      "browserify-shim",
63
+      "browserify-css",
64
+      [
65
+        "babelify",
66
+        {
67
+          "ignore": "node_modules"
68
+        }
69
+      ]
70
+    ]
71
+  },
72
+  "babel": {
73
+    "presets": [
74
+      "es2015"
75
+    ]
76
+  },
65 77
   "browser": {
66
-    "aui-css": "./node_modules/@atlassian/aui/dist/aui/css/aui.min.css",
67
-    "aui-experimental-css": "./node_modules/@atlassian/aui/dist/aui/css/aui-experimental.min.css",
68
-    "autosize": "./node_modules/autosize/build/jquery.autosize.js",
69
-    "popover": "./node_modules/bootstrap/js/popover.js",
78
+    "jquery": "./node_modules/jquery/dist/jquery.js",
79
+    "jquery-ui": "./node_modules/jquery-ui/jquery-ui.js",
80
+    "strophe": "./node_modules/strophe/strophe.js",
70 81
     "strophe-disco": "./node_modules/strophejs-plugins/disco/strophe.disco.js",
71 82
     "strophe-caps": "./node_modules/strophejs-plugins/caps/strophe.caps.jsonly.js",
72
-    "tooltip": "./node_modules/bootstrap/js/tooltip.js"
83
+    "toastr": "./node_modules/toastr/toastr.js",
84
+    "tooltip": "./node_modules/bootstrap/js/tooltip.js",
85
+    "popover": "./node_modules/bootstrap/js/popover.js",
86
+    "jQuery-Impromptu": "./node_modules/jQuery-Impromptu/dist/jquery-impromptu.js",
87
+    "autosize": "./node_modules/autosize/build/jquery.autosize.js",
88
+    "aui": "./node_modules/@atlassian/aui/dist/aui/js/aui.js",
89
+    "aui-experimental": "./node_modules/@atlassian/aui/dist/aui/js/aui-experimental.js",
90
+    "aui-css": "./node_modules/@atlassian/aui/dist/aui/css/aui.min.css",
91
+    "aui-experimental-css": "./node_modules/@atlassian/aui/dist/aui/css/aui-experimental.min.css"
92
+  },
93
+  "browserify-shim": {
94
+    "jquery": [
95
+      "$"
96
+    ],
97
+    "strophe": {
98
+      "exports": "Strophe",
99
+      "depends": [
100
+        "jquery:$"
101
+      ]
102
+    },
103
+    "strophe-disco": {
104
+      "depends": [
105
+        "strophe:Strophe"
106
+      ]
107
+    },
108
+    "tooltip": {
109
+      "depends": "jquery:jQuery"
110
+    },
111
+    "popover": {
112
+      "depends": "jquery:jQuery"
113
+    },
114
+    "jQuery-Impromptu": {
115
+      "depends": "jquery:jQuery"
116
+    },
117
+    "aui-experimental": {
118
+      "depends": "aui:AJS"
119
+    },
120
+    "jquery-contextmenu": {
121
+      "depends": "jquery:jQuery"
122
+    },
123
+    "autosize": {
124
+      "depends": "jquery:jQuery"
125
+    },
126
+    "browserify-css": {
127
+        "autoInject": true
128
+    }
73 129
   }
74 130
 }

+ 0
- 119
webpack.config.babel.js Dosyayı Görüntüle

@@ -1,119 +0,0 @@
1
-import process from 'process';
2
-import webpack from 'webpack';
3
-
4
-const aui_css = __dirname + '/node_modules/@atlassian/aui/dist/aui/css/';
5
-const minimize
6
-    = process.argv.indexOf('-p') != -1
7
-        || process.argv.indexOf('--optimize-minimize') != -1;
8
-const strophe = /\/node_modules\/strophe(js-plugins)?\/.*\.js$/;
9
-
10
-// The base Webpack configuration to bundle the JavaScript artifacts of
11
-// jitsi-meet such as app.bundle.js and external_api.js.
12
-const config = {
13
-    devtool: 'source-map',
14
-    module: {
15
-        loaders: [{
16
-            // Transpile ES2015 (aka ES6) to ES5.
17
-
18
-            exclude: [
19
-                __dirname + '/modules/RTC/adapter.screenshare.js',
20
-                __dirname + '/node_modules/'
21
-            ],
22
-            loader: 'babel',
23
-            test: /\.js$/
24
-        },{
25
-            // Expose jquery as the globals $ and jQuery because it is expected
26
-            // to be available in such a form by multiple jitsi-meet
27
-            // dependencies including AUI, lib-jitsi-meet.
28
-
29
-            loader: 'expose?$!expose?jQuery',
30
-            test: /\/node_modules\/jquery\/.*\.js$/
31
-        },{
32
-            // Disable AMD for the Strophe.js library or its imports will fail
33
-            // at runtime.
34
-
35
-            loader: 'imports?define=>false&this=>window',
36
-            test: strophe
37
-        },{
38
-            // Allow CSS to be imported into JavaScript.
39
-
40
-            loaders: [
41
-                'style',
42
-                'css'
43
-            ],
44
-            test: /\.css$/
45
-        },{
46
-            // Emit the static assets of AUI such as images that are referenced
47
-            // by CSS into the output path.
48
-
49
-            include: aui_css,
50
-            loader: 'file',
51
-            query: {
52
-                context: aui_css,
53
-                name: '[path][name].[ext]'
54
-            },
55
-            test: /\.(gif|png|svg)$/
56
-        }],
57
-        noParse: [
58
-            // Do not parse the files of the Strophe.js library or at least
59
-            // parts of the properties of the Strophe global variable will be
60
-            // missing and strophejs-plugins will fail at runtime.
61
-            strophe
62
-        ]
63
-    },
64
-    node: {
65
-        // Allow the use of the real filename of the module being executed. By
66
-        // default Webpack does not leak path-related information and provides a
67
-        // value that is a mock (/index.js).
68
-        __filename: true
69
-    },
70
-    output: {
71
-        filename: '[name]' + (minimize ? '.min' : '') + '.js',
72
-        libraryTarget: 'umd',
73
-        path: __dirname + '/build',
74
-        sourceMapFilename: '[name].' + (minimize ? 'min' : 'js') + '.map'
75
-    },
76
-    resolve: {
77
-        alias: {
78
-            aui:
79
-                '@atlassian/aui/dist/aui/js/aui'
80
-                    + (minimize ? '.min' : '')
81
-                    + '.js',
82
-            'aui-experimental':
83
-                '@atlassian/aui/dist/aui/js/aui-experimental'
84
-                    + (minimize ? '.min' : '')
85
-                    + '.js',
86
-            jquery: 'jquery/dist/jquery' + (minimize ? '.min' : '') + '.js',
87
-            'jQuery-Impromptu':
88
-                'jQuery-Impromptu/dist/jquery-impromptu'
89
-                    + (minimize ? '.min' : '')
90
-                    + '.js',
91
-        },
92
-        packageAlias: 'browser'
93
-    }
94
-};
95
-
96
-export default [{
97
-    // The Webpack configuration to bundle app.bundle.js (aka APP).
98
-
99
-    ...config,
100
-    entry: {
101
-       'app.bundle': './app.js'
102
-    },
103
-    output: {
104
-        ...config.output,
105
-        library: 'APP'
106
-    }
107
-}, {
108
-    // The Webpack configuration to bundle external_api.js (aka
109
-    // JitsiMeetExternalAPI).
110
-
111
-    ...config,
112
-    entry: {
113
-       'external_api': './modules/API/external/external_api.js'
114
-    },
115
-    output: {
116
-        ...config.output,
117
-        library: 'JitsiMeetExternalAPI'
118
-    }
119
-}];

Loading…
İptal
Kaydet