-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (35 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export PATH := node_modules/.bin:$(PATH)
# Root path to asset files
assets_dir := www/assets
# Root path for assets_dir files after build
build_dir := www/build
build_sub_dir := $(build_dir)/css $(build_dir)/css/vendor
# Main Datathletics CSS file
site_css := /css/style.css
# Vendor files
vendor_css := /css/vendor/bootstrap.css
TIMSTAMP := $$(date +'%Y%m%d%H%M%S')
cache_buster := $(subst %,$(TIMSTAMP),?v=%)
all:build
build:
@echo ">>> Build started ...."
@echo ">>> NODE_ENV =>" $(NODE_ENV)
@rm -rf $(build_dir) && mkdir $(build_dir) && mkdir $(build_sub_dir)
@echo ">>> Removed old CSS folder ...."
@cp -r $(assets_dir)/images $(build_dir)/images
@echo ">>> Copied images ...."
@cp -r $(assets_dir)/js $(build_dir)/js
@echo ">>> Copied JS files"
@myth -c $(assets_dir)/$(site_css) > $(build_dir)$(site_css)
@myth -c $(assets_dir)/$(vendor_css) > $(build_dir)$(vendor_css)
@echo ">>> Done bundling and compressing CSS ...."
@echo ">>> Build finished successfully...."
deploy:
git push heroku master
print-vars:
@echo $(build_dir)
@echo $(build_sub_dir)
clean:
@rm -rf $(build_dir)
@echo ">>> Removed build files ...."
.PHONY: all build deploy print-vars