summaryrefslogtreecommitdiff
path: root/www/Makefile
diff options
context:
space:
mode:
authorngharo <nick@ngha.ro>2018-01-03 19:47:41 -0600
committerngharo <nick@ngha.ro>2018-01-03 19:47:41 -0600
commit1f4160511f4853de614355f45b94152fbd19e29e (patch)
tree77e144270ae0ecf8cebe8857246bb75ae6092013 /www/Makefile
parentf920c7da0618fd9f4181c2c78ef054e324185355 (diff)
downloadimOk-www-master.tar.xz
imOk-www-master.zip
-~-~ Under Construction ~-~-~~~~~HEADmaster
Diffstat (limited to 'www/Makefile')
-rw-r--r--www/Makefile44
1 files changed, 26 insertions, 18 deletions
diff --git a/www/Makefile b/www/Makefile
index a9f86e7..bc48017 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1,28 +1,36 @@
DEPLOY_TARGET="/var/www/imok.ngha.ro/"
-PATH := node_modules/.bin:$(PATH)
-SHELL := /bin/bash
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+DEPLOY_CMD := rsync --delete -a
-css_out := index.css
-js_out := index.js
-libs := lib/app.js
-styles := styles/app.scss
+css_out := index.css
+js_out := index.js
+css_smap := $(css_out:%.css=%.css.map)
+js_smap := $(js_out:%.js=%.js.map)
-.PHONY: all clean deploy
+.PHONY: all clean build deploy deploy-prod
-all: $(app_bundle)
+$(js_out): src/app.js
+ browserify --debug $< | \
+ babel --source-maps inline --presets env -o $@
+# uglifyjs -c -m "reserved=['require','exports']" \
+ --source-map "content='inline',url='index.js.map',filename='index.js.map'" \
+ --output $@
-%.js:
- babel $< --out-file $@
-
-%.css:
+$(css_out): styles/app.scss
sass --style compressed $< $@
-index.css: $(styles)
-index.js: $(libs)
-build: index.css index.js
+clean:
+ rm index.{js,css}*
+
+$(css_smap) $(js_smap): $(css_out) $(js_out)
+
+build deploy deploy-prod: $(css_out) $(js_out)
-deploy: index.*
- rsync -vr $^ $(DEPLOY_TARGET)
+#deploy: $(css_smap) $(js_smap)
+deploy: $(css_smap)
+ $(DEPLOY_CMD) $^ $(DEPLOY_TARGET)
-all: build deploy
+deploy-prod:
+ $(DEPLOY_CMD) $^ $(DEPLOY_TARGET)