Parcourir la source

Uses source maps to the actual source files (i.e. modules/), removes the separate debug targets, uglify before deploy.

master
Boris Grozev il y a 9 ans
Parent
révision
2702fa0175
2 fichiers modifiés avec 12 ajouts et 18 suppressions
  1. 10
    17
      Makefile
  2. 2
    1
      package.json

+ 10
- 17
Makefile Voir le fichier

@@ -1,34 +1,27 @@
1
+NPM = npm
1 2
 BROWSERIFY = ./node_modules/.bin/browserify
3
+UGLIFYJS = ./node_modules/.bin/uglifyjs
4
+EXORCIST = ./node_modules/.bin/exorcist
2 5
 DEPLOY_DIR = libs
3
-GLOBAL_FLAGS = -x jquery -e
4
-NPM = npm
6
+BROWSERIFY_FLAGS = -d -x jquery 
5 7
 OUTPUT_DIR = .
6
-UGLIFYJS = ./node_modules/.bin/uglifyjs
7
-
8
-all: compile deploy clean uglify
9
-
10
-compile:FLAGS = $(GLOBAL_FLAGS)
11
-compile: app
12
-
13
-debug: compile-debug deploy clean
14 8
 
15
-compile-debug:FLAGS = -d $(GLOBAL_FLAGS)
16
-compile-debug: app
9
+all: compile uglify deploy clean 
17 10
 
18
-app:
19
-	$(NPM) update && $(BROWSERIFY) $(FLAGS) app.js -s APP -o $(OUTPUT_DIR)/app.bundle.js
11
+compile:
12
+	$(NPM) update && $(BROWSERIFY) $(BROWSERIFY_FLAGS) -e app.js -s APP | $(EXORCIST) $(OUTPUT_DIR)/app.bundle.js.map > $(OUTPUT_DIR)/app.bundle.js
20 13
 
21 14
 clean:
22
-	rm -f $(OUTPUT_DIR)/*.bundle.js
15
+	rm -f $(OUTPUT_DIR)/app.bundle.*
23 16
 
24 17
 deploy:
25 18
 	mkdir -p $(DEPLOY_DIR) && \
26
-	cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && \
19
+	cp $(OUTPUT_DIR)/app.bundle.min.js $(OUTPUT_DIR)/app.bundle.min.map $(DEPLOY_DIR) && \
27 20
 	./bump-js-versions.sh && \
28 21
 	([ ! -x deploy-local.sh ] || ./deploy-local.sh)
29 22
 
30 23
 uglify:
31
-	$(UGLIFYJS) -p relative libs/app.bundle.js -o libs/app.bundle.min.js --source-map libs/app.bundle.js.map --source-map-url=app.bundle.js.map
24
+	$(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
32 25
 
33 26
 source-package:
34 27
 	mkdir -p source_package/jitsi-meet && \

+ 2
- 1
package.json Voir le fichier

@@ -31,7 +31,8 @@
31 31
       "precommit-hook": "3.0.0",
32 32
       "jshint": "2.8.0",
33 33
       "uglify-js": "2.4.24",
34
-      "browserify": "11.1.x"
34
+      "browserify": "11.1.x",
35
+      "exorcist": "*"
35 36
   },
36 37
   "license": "Apache-2.0",
37 38
   "scripts": {

Chargement…
Annuler
Enregistrer