forked from jeromegn/Backbone.localStorage
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
49 lines (38 loc) · 1.18 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
BIN = ./node_modules/.bin
BROWSERS ?= Chrome
CHROMIUM ?= ./node_modules/.bin/run-headless-chromium
ESLINT ?= ./node_modules/.bin/eslint
HTTPSERVE ?= ./node_modules/.bin/http-server
HTTPSERVE_PORT ?= 8000
KARMA ?= ./node_modules/.bin/karma
KARMA_ARGS ?=
NPX ?= ./node_modules/.bin/npx
clean:
rm -rf node_modules stamp-npm
stamp-npm: package.json package-lock.json
npm install
touch stamp-npm
.PHONY: eslint
eslint: stamp-npm
$(ESLINT) src/
$(ESLINT) test/
.PHONY: serve
serve:
$(HTTPSERVE) -p $(HTTPSERVE_PORT) -c-1
.PHONY: check
check: stamp-npm eslint
$(KARMA) start --browsers $(BROWSERS) $(KARMA_ARGS)
# Get version number from package.json, need this for tagging.
version = $(shell node -e "console.log(JSON.parse(require('fs').readFileSync('package.json')).version)")
dist/backbone.browserStorage.js: src webpack.config.js stamp-npm
$(NPX) webpack
dist/backbone.browserStorage.min.js: src webpack.config.js stamp-npm
$(NPX) webpack --mode=production
.PHONY: build
build: dist/backbone.browserStorage.js dist/backbone.browserStorage.min.js
# npm publish, public-docs and tag
publish :
npm publish
git push
git tag v$(version)
git push --tags origin master