-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
75 lines (56 loc) · 1.57 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
73
74
75
TEST_FILES = $(shell ls -S `find test/unit -type f -name "*.test.js" -print`)
#LESS_FILES = $(shell find resources/assets/less -name '*.less')
#CSS_FILES = $(LESS_FILES:resources/assets/less/%.less=public/assets/css/%.css)
#JS_FILES = $(shell find resources/assets/js -name '*.js')
#BUILD_JS_FILES = $(JS_FILES:resources/%.js=public/%.min.js)
export PATH := node_modules/.bin:$(PATH)
export SHELL := /bin/bash
install:
@cnpm install
jshint: install
@jshint ./app ./resources/assets/js
server:
@NODE_ENV=dev npm run server
dev-server: build server
dev:
@NODE_ENV=dev \
nodemon -q\
-e js,json,less \
--ignore package.json \
--ignore node_modules \
--ignore public \
--ignore sftp-config.json \
-x 'make dev-server'
test:
@NODE_ENV=test mocha \
--harmony \
--reporter spec \
--timeout 5000 \
--require should \
--require co-mocha \
--require ./test/helper.js \
$(TEST_FILES)
#%.css:
# @lessc --autoprefix --clean-css $(subst public, resources, $(subst css,less,$@)) $@
#%.min.js:%.js
# @uglifyjs --compress --output $@ $^
copy: copy_tips
@mkdir -p public/assets
@cp -rf resources/assets/libs public/assets/libs
@cp -rf resources/assets/images public/assets/images
#es6to5:
# @babel resources/assets/js --out-dir public/assets/js >/dev/null
#scripts: scripts_tips es6to5 $(BUILD_JS_FILES)
#less: less_tips $(CSS_FILES)
build: clean copy
@echo 'webpack build...'
@webpack
clean-build:
@rm -rf public/assets
clean: clean-build
copy_tips:
@echo 'copy lib files and images...'
scripts_tips:
@echo 'build js files...'
less_tips:
@echo 'build less files...'