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

pull/361/head 675
Boris Grozev 10 years ago
parent 260b610725
commit 2702fa0175
  1. 27
      Makefile
  2. 3
      package.json

@ -1,34 +1,27 @@
NPM = npm
BROWSERIFY = ./node_modules/.bin/browserify BROWSERIFY = ./node_modules/.bin/browserify
UGLIFYJS = ./node_modules/.bin/uglifyjs
EXORCIST = ./node_modules/.bin/exorcist
DEPLOY_DIR = libs DEPLOY_DIR = libs
GLOBAL_FLAGS = -x jquery -e BROWSERIFY_FLAGS = -d -x jquery
NPM = npm
OUTPUT_DIR = . OUTPUT_DIR = .
UGLIFYJS = ./node_modules/.bin/uglifyjs
all: compile deploy clean uglify
compile:FLAGS = $(GLOBAL_FLAGS)
compile: app
debug: compile-debug deploy clean
compile-debug:FLAGS = -d $(GLOBAL_FLAGS) all: compile uglify deploy clean
compile-debug: app
app: compile:
$(NPM) update && $(BROWSERIFY) $(FLAGS) app.js -s APP -o $(OUTPUT_DIR)/app.bundle.js $(NPM) update && $(BROWSERIFY) $(BROWSERIFY_FLAGS) -e app.js -s APP | $(EXORCIST) $(OUTPUT_DIR)/app.bundle.js.map > $(OUTPUT_DIR)/app.bundle.js
clean: clean:
rm -f $(OUTPUT_DIR)/*.bundle.js rm -f $(OUTPUT_DIR)/app.bundle.*
deploy: deploy:
mkdir -p $(DEPLOY_DIR) && \ mkdir -p $(DEPLOY_DIR) && \
cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && \ cp $(OUTPUT_DIR)/app.bundle.min.js $(OUTPUT_DIR)/app.bundle.min.map $(DEPLOY_DIR) && \
./bump-js-versions.sh && \ ./bump-js-versions.sh && \
([ ! -x deploy-local.sh ] || ./deploy-local.sh) ([ ! -x deploy-local.sh ] || ./deploy-local.sh)
uglify: uglify:
$(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 $(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
source-package: source-package:
mkdir -p source_package/jitsi-meet && \ mkdir -p source_package/jitsi-meet && \

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

Loading…
Cancel
Save