-
Notifications
You must be signed in to change notification settings - Fork 138
/
Makefile
53 lines (40 loc) · 1.17 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
BIN = node_modules/.bin
WEBPACK = $(BIN)/webpack
KARMA = $(BIN)/karma
COVERALLS = $(BIN)/coveralls
SERVER = $(BIN)/webpack-dev-server --inline --hot --port 8020
SRC = index.js $(shell find . -type f -name '*.js' ! -path './build/*' -o -name '*.css' ! -path './build/*')
TESTS = $(shell find test -type f -name '*.js')
server: build
ifdef RECURLY_JS_CERT
@$(SERVER) --https --cert $(RECURLY_JS_CERT) --key $(RECURLY_JS_KEY)
else
@$(SERVER) --https
endif
server-http: build
@$(SERVER)
build: build/recurly.min.js
build/recurly.js: index.js $(SRC) node_modules
@mkdir -p $(@D)
@$(WEBPACK) --display-reasons --display-chunks
build/recurly.min.js: build/recurly.js
@$(WEBPACK) -p
build/test.js: $(SRC) $(TESTS)
@$(WEBPACK) --config webpack.test.config.js
test: build build/test.js
@$(KARMA) start karma.conf.js
test-ci: build build/test.js
@$(KARMA) start karma.ci.conf.js
ifdef REPORT_COVERAGE
@cat ./build/reports/coverage/lcov.info | $(COVERALLS)
@rm -rf ./build/reports
endif
node_modules: package.json
@npm install --silent
clean:
@rm -rf node_modules build
lint:
./node_modules/.bin/eslint ./lib
lint-fix:
./node_modules/.bin/eslint ./lib --fix
.PHONY: test clean