Skip to content

Commit

Permalink
Makefile tweaks
Browse files Browse the repository at this point in the history
Re-introduce `make browser` to make a standalone build of `debug.js`
for the web browser.
  • Loading branch information
TooTallNate committed Aug 8, 2017
1 parent 87880f6 commit ce1a236
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions Makefile
Expand Up @@ -15,36 +15,39 @@ YARN ?= $(shell which yarn)
PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
BROWSERIFY ?= $(NODE) $(BIN)/browserify

.FORCE:

install: node_modules

browser: dist/debug.js

node_modules: package.json
@NODE_ENV= $(PKG) install
@touch node_modules

lint: .FORCE
eslint *.js src/*.js

test-node: .FORCE
istanbul cover node_modules/mocha/bin/_mocha -- test/**.js

test-browser: .FORCE
mkdir -p dist

dist/debug.js: src/*.js node_modules
@mkdir -p dist
@$(BROWSERIFY) \
--standalone debug \
. > dist/debug.js

lint:
eslint *.js src/*.js

test-node:
istanbul cover node_modules/mocha/bin/_mocha -- test/**.js

test-browser:
$(MAKE) browser
karma start --single-run
rimraf dist

test: .FORCE
test:
concurrently \
"make test-node" \
"make test-browser"

coveralls:
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

clean:
rimraf dist

.PHONY: all install clean distclean

0 comments on commit ce1a236

Please sign in to comment.