Skip to content

Commit 2702fa0

Browse files
committed
Uses source maps to the actual source files (i.e. modules/), removes the separate debug targets, uglify before deploy.
1 parent 260b610 commit 2702fa0

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

Makefile

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1+
NPM = npm
12
BROWSERIFY = ./node_modules/.bin/browserify
3+
UGLIFYJS = ./node_modules/.bin/uglifyjs
4+
EXORCIST = ./node_modules/.bin/exorcist
25
DEPLOY_DIR = libs
3-
GLOBAL_FLAGS = -x jquery -e
4-
NPM = npm
6+
BROWSERIFY_FLAGS = -d -x jquery
57
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
148

15-
compile-debug:FLAGS = -d $(GLOBAL_FLAGS)
16-
compile-debug: app
9+
all: compile uglify deploy clean
1710

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
2013

2114
clean:
22-
rm -f $(OUTPUT_DIR)/*.bundle.js
15+
rm -f $(OUTPUT_DIR)/app.bundle.*
2316

2417
deploy:
2518
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) && \
2720
./bump-js-versions.sh && \
2821
([ ! -x deploy-local.sh ] || ./deploy-local.sh)
2922

3023
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
3225

3326
source-package:
3427
mkdir -p source_package/jitsi-meet && \

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"precommit-hook": "3.0.0",
3232
"jshint": "2.8.0",
3333
"uglify-js": "2.4.24",
34-
"browserify": "11.1.x"
34+
"browserify": "11.1.x",
35+
"exorcist": "*"
3536
},
3637
"license": "Apache-2.0",
3738
"scripts": {

0 commit comments

Comments
 (0)