forked from DylanPiercey/receptacle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (43 loc) · 1.38 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
# Files
BIN = node_modules/.bin
SRC_IN = index.js
SRC_OUT = dist/receptacle.js
SRC_OUT_MAP = dist/receptacle.map.js
TESTS_IN = test/*.test.js
# Tools
standard = $(BIN)/standard
snazzy = $(BIN)/snazzy
coveralls = $(BIN)/coveralls
istanbul = $(BIN)/istanbul
mocha = $(BIN)/_mocha
browserify = $(BIN)/browserify
exorcist = $(BIN)/exorcist
uglifyjs = $(BIN)/uglifyjs
# Run standard linter.
lint:
$(standard) --verbose | $(snazzy)
# Save code coverage to coveralls
coveralls:
cat coverage/lcov.info | $(coveralls)
# Run standard linter, mocha tests and istanbul coverage.
test:
@NODE_ENV=test \
$(istanbul) cover \
$(mocha) --report html -- -u exports $(TESTS_IN)
# Run standard linter, mocha tests and istanbul coverage but bail early and only save lcov coverage report.
test-ci:
@NODE_ENV=test \
${istanbul} cover \
$(mocha) --report lcovonly -- -u exports $(TESTS_IN) --bail
# Build dist file for downloads.
build:
@NODE_ENV=test \
$(browserify) -p bundle-collapser/plugin --standalone receptacle --debug $(SRC_IN) | \
$(exorcist) $(SRC_OUT_MAP) > $(SRC_OUT); \
$(uglifyjs) $(SRC_OUT) --output $(SRC_OUT) \
--in-source-map $(SRC_OUT_MAP) \
--screw_ie8 \
--compress \
warnings=false,unused,sequences,properties,dead_code,drop_debugger,conditionals,comparisons,evaluate,booleans,loops,hoist_funs,if_return,join_vars,cascade,drop_console,keep_fargs=false\
--mangle
.PHONY: test