-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (38 loc) · 1.5 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
.PHONY: cleardb dist install mocks/article server tests tests/server
NPM_BIN=$(shell npm bin)
astroturf:
node --harmony ./bin/astroturf
cleardb:
node --harmony ./bin/clear-db
dist:
mkdir -p public/dist
ifeq ($(NODE_ENV), production)
$(MAKE) dist/production
else
$(MAKE) dist/development
endif
dist/development:
node $(NPM_BIN)/browserify -t envify ./node_modules/article-comments/javascripts/main.js > ./public/dist/app.js
du -h ./public/dist/app.js
node $(NPM_BIN)/lessc ./node_modules/article-comments/styles/style.less > ./public/dist/style.css
du -h ./public/dist/style.css
node $(NPM_BIN)/lessc ./node_modules/article-comments/styles/user-comments.less > ./public/dist/user-comments.css
du -h ./public/dist/user-comments.css
dist/production: dist/development
$(NPM_BIN)/uglifyjs ./public/dist/app.js -o ./public/dist/app.js -m toplevel -c
du -h ./public/dist/app.js
$(NPM_BIN)/cleancss ./public/dist/style.css -o ./public/dist/style.css
du -h ./public/dist/style.css
$(NPM_BIN)/cleancss ./public/dist/user-comments.css -o ./public/dist/user-comments.css
du -h ./public/dist/user-comments.css
install:
npm install
server: dist
node --harmony ./node_modules/server
# TODO: the tap test runner doesn't spawn child processes with node flags(?)
tests:
node --harmony $(NPM_BIN)/tap tests/services/*.js tests/ui/*.js tests/transforms/*.js tests/schemas/*.js tests/views/*.js
tests/server:
node --harmony tests/server/index.js
# TODO: clean
# for package in `npm ls`; do npm uninstall $package; done;