-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
73 lines (57 loc) · 1.92 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
VERSION := $(shell awk '/defproject/ { gsub("\"", "", $$3); print $$3 }' project.clj)
JAR := target/pump-$(VERSION).jar
.PHONY: gcc-react.js
help:
@echo "Available commands:"
@echo " pub - publish jar to clojars"
@echo " js - run autobuild for example app"
@echo " min - compile minified version of example app"
js:
lein cljsbuild auto main
min:
lein cljsbuild once min
pub: pom.xml $(JAR)
scp $^ clojars@clojars.org:
jar: pom.xml $(JAR)
pom.xml: project.clj
lein pom
$(JAR): $(shell find src -name '*.clj')
lein jar
# npm install dgraph
# brew install jq
gcc-react:
dgraph ~/dev/web/react/build/modules/React.js | \
jq '.[] | .id' | \
xargs closure-compiler \
--compilation_level WHITESPACE_ONLY \
--formatting PRETTY_PRINT \
--common_js_entry_module React \
--common_js_module_path_prefix ~/dev/web/react/build/modules/ \
--process_common_js_modules \
--module auto \
--module_output_path_prefix resources/react/
# @echo 'goog.provide("React");' > resources/react/React.js
# @echo 'goog.require("module$React");' >> resources/react/React.js
# @echo 'var React = module$React;' >> resources/react/React.js
adv-react:
cd resources/static && closure-compiler \
--js_output_file react.adv-min.js \
--externs ../externs/react.js \
--compilation_level ADVANCED_OPTIMIZATIONS \
--create_source_map %outname%.map \
--source_map_format=V3 \
../react/*.js
echo '//@ sourceMappingURL=react.adv-min.js.map' >> resources/static/react.adv-min.js
adv-dumb:
closure-compiler \
--compilation_level ADVANCED_OPTIMIZATIONS \
--js_output_file resources/static/dumb.adv.js \
resources/react/*.js resources/static/dumbchat.js
qwe:
cd resources/target && closure-compiler \
--compilation_level ADVANCED_OPTIMIZATIONS \
--js_output_file pump.min.js \
--create_source_map %outname%.map \
--source_map_format=V3 \
pump.js
echo '//@ sourceMappingURL=pump.min.js.map' >> resources/target/pump.min.js