-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
77 lines (57 loc) · 1.12 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
76
77
BIN := ./node_modules/.bin
BROWSERIFY := $(BIN)/browserify
POSTCSS := $(BIN)/postcss
ESLINT := $(BIN)/eslint
#
# Default.
#
default: build test-style node_modules
#
# Build.
#
build: node_modules
@mkdir -p build
@cp preview.html build/index.html
@$(BROWSERIFY) index.js -t [babelify] > build/preview.js
@$(POSTCSS) -u postcss-import -u postcss-url --postcss-url.url "copy" -u postcss-cssnext -u autoprefixer -o build/preview.css ./preview.css
#
# Preview.
#
preview: node_modules
@node --harmony support/preview
#
# Dist.
#
dist: node_modules
@mkdir -p dist
@$(BROWSERIFY) index.js -t [ babelify --presets [ es2015 react ] ] > dist/matter.js
@$(POSTCSS) -u postcss-import -u postcss-url --postcss-url.url "copy" -u postcss-cssnext -u autoprefixer -o dist/matter.css ./index.css
#
# Deploy.
#
deploy: node_modules build
@node support/deploy.js
#
# Test style.
#
test-style:
@$(ESLINT) ./lib
#
# Dependencies.
#
node_modules: package.json
@npm install
#
# Clean.
#
clean:
@rm -rf build *.log
#
# Clean dependencies.
#
clean-deps:
@rm -rf node_modules components
#
# Phonies.
#
.PHONY: preview deploy dist test-style