summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-03-05 18:35:34 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-03-05 18:35:34 -0500
commitb71111a0d852263498e610e370ccb94f04b21c8b (patch)
tree4ffd9afa0a1acf73df8b2637266c1290643b510a
parent3a2f43e8d5c85a116845c360902f268fd2798ffa (diff)
downloadhtml5ks-b71111a0d852263498e610e370ccb94f04b21c8b.tar.xz
html5ks-b71111a0d852263498e610e370ccb94f04b21c8b.zip
bah
-rw-r--r--Makefile34
-rw-r--r--nginx.inc.conf2
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;
}