Uses source maps to the actual source files (i.e. modules/), removes the separate debug targets, uglify before deploy.
This commit is contained in:
parent
260b610725
commit
2702fa0175
29
Makefile
29
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 && \
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in New Issue