-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (34 loc) · 1.09 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
WATCHIFY = ./node_modules/.bin/watchify
WATCH = ./node_modules/.bin/watch
LESS = ./node_modules/.bin/lessc
BROWSERIFY = ./node_modules/.bin/browserify
UGLIFY = ./node_modules/.bin/uglifyjs
CLEANCSS = ./node_modules/.bin/cleancss
MOCHA = ./node_modules/.bin/mocha
BIN = ./bin/run.js
NAME = politics-2016
MOCHA-OPTS = --compilers js:babel-register --ui exports --timeout 5000 --bail
start:
${BIN}
start-dev:
${BIN} --dev
watch-js: build-js
${WATCHIFY} -e -s $(NAME) ./src/js/index.jsx -t babelify -o public/js/bundle.js -d -v
watch-css: build-css
${WATCH} "${MAKE} build-css" src/less
watch:
${MAKE} watch-js & ${MAKE} watch-css
build-js:
${BROWSERIFY} -e -s $(NAME) ./src/js/index.jsx -t babelify > public/js/bundle.js
build-css:
${LESS} src/less/app.less > public/css/bundle.css
build: build-js build-css
minify-js:
${UGLIFY} public/js/bundle.js > public/js/bundle.min.js
minify-css:
${CLEANCSS} public/css/bundle.css > public/css/bundle.min.css
test:
${MOCHA} ${MOCHA-OPTS} --reporter spec
data:
cat data/candidates.json | bin/data.js
.PHONY: test data