From b71111a0d852263498e610e370ccb94f04b21c8b Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Wed, 5 Mar 2014 18:35:34 -0500 Subject: bah --- Makefile | 34 +++++++++++++++------------------- nginx.inc.conf | 2 ++ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 72eb70c..14372c2 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,11 @@ WEBPMUX ?= webpmux CONVERT ?= convert APNGASM ?= apngasm NPM ?= npm -DUGLIFYJS := node_modules/.bin/uglifyjs -UGLIFYJS ?= $(DUGLIFYJS) -#PACKR ?= packr -#CLOSURE_COMPILER ?= java -jar compiler.jar +JS_COMPRESSOR ?= uglifyjs +LOCAL_UGLIFYJS := node_modules/.bin/uglifyjs +UGLIFYJS ?= $(LOCAL_UGLIFYJS) +PACKR ?= packr +CLOSURE_COMPILER ?= java -jar compiler.jar ifndef MINIMAL ZOPFLIPNG ?= zopflipng DEFLOPT ?= wine DeflOpt @@ -162,29 +163,24 @@ when/build/when.js: when js: $(JSOUT) -# note that packr doesn't actually work -ifndef PACKR -ifndef CLOSURE_COMPILER +ifeq ($(JS_COMPRESSOR), uglifyjs) $(JSOUT): $(JS) $(UGLIFYJS) + $(UGLIFYJS) $(JS) -o "$@" --source-map "$@".map --source-map-url ./all.min.js.map --screw-ie8 -p 2 -m -c unsafe=true,drop_debugger=false else $(JSOUT): $(JS) -endif -endif -ifdef PACKR +# note that packr doesn't actually work +ifeq ($(JS_COMPRESSOR), packr) $(PACKR) $(JS) -o "$@" else - ifdef CLOSURE_COMPILER - $(CLOSURE_COMPILER) --compilation_level SIMPLE_OPTIMIZATIONS --create_source_map "$@".map --js $(subst $(SPACE), --js ,$(JS)) --js_output_file "$@" - else - $(UGLIFYJS) $(JS) -o "$@" --source-map "$@".map --source-map-url ./all.min.js.map --screw-ie8 -p 2 -m -c unsafe=true,drop_debugger=false - endif -endif +ifeq ($(JS_COMPRESSOR), closure_compiler) + $(CLOSURE_COMPILER) --compilation_level SIMPLE_OPTIMIZATIONS --create_source_map "$@".map --js $(subst $(SPACE), --js ,$(JS)) --js_output_file "$@" +endif # ($(JS_COMPRESSOR), closure_compiler) +endif # ($(JS_COMPRESSOR), packr) +endif # ($(JS_COMPRESSOR), uglifyjs) -ifeq ($(DUGLIFYJS), $(UGLIFYJS)) -$(UGLIFYJS): package.json +$(LOCAL_UGLIFYJS): package.json $(NPM) update touch "$@" -endif # === MISC === diff --git a/nginx.inc.conf b/nginx.inc.conf index 890a674..bdc514f 100644 --- a/nginx.inc.conf +++ b/nginx.inc.conf @@ -1,3 +1,5 @@ +index index.html; + location /json/ { expires 1y; } -- cgit v1.2.3-70-g09d2