From 2702fa01752b2c0224ab9eb40363313f580db55d Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Thu, 17 Sep 2015 16:40:02 -0500 Subject: [PATCH] Uses source maps to the actual source files (i.e. modules/), removes the separate debug targets, uglify before deploy. --- Makefile | 29 +++++++++++------------------ package.json | 3 ++- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index c8d0f5168..b1eab9544 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,27 @@ -BROWSERIFY = ./node_modules/.bin/browserify -DEPLOY_DIR = libs -GLOBAL_FLAGS = -x jquery -e NPM = npm -OUTPUT_DIR = . +BROWSERIFY = ./node_modules/.bin/browserify UGLIFYJS = ./node_modules/.bin/uglifyjs +EXORCIST = ./node_modules/.bin/exorcist +DEPLOY_DIR = libs +BROWSERIFY_FLAGS = -d -x jquery +OUTPUT_DIR = . -all: compile deploy clean uglify +all: compile uglify deploy clean -compile:FLAGS = $(GLOBAL_FLAGS) -compile: app - -debug: compile-debug deploy clean - -compile-debug:FLAGS = -d $(GLOBAL_FLAGS) -compile-debug: app - -app: - $(NPM) update && $(BROWSERIFY) $(FLAGS) app.js -s APP -o $(OUTPUT_DIR)/app.bundle.js +compile: + $(NPM) update && $(BROWSERIFY) $(BROWSERIFY_FLAGS) -e app.js -s APP | $(EXORCIST) $(OUTPUT_DIR)/app.bundle.js.map > $(OUTPUT_DIR)/app.bundle.js clean: - rm -f $(OUTPUT_DIR)/*.bundle.js + rm -f $(OUTPUT_DIR)/app.bundle.* deploy: 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 && \ ([ ! -x deploy-local.sh ] || ./deploy-local.sh) 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: mkdir -p source_package/jitsi-meet && \ diff --git a/package.json b/package.json index 5375a5427..4a82948df 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "precommit-hook": "3.0.0", "jshint": "2.8.0", "uglify-js": "2.4.24", - "browserify": "11.1.x" + "browserify": "11.1.x", + "exorcist": "*" }, "license": "Apache-2.0", "scripts": {