2016-01-12 13:55:48 +00:00
|
|
|
WATCHIFY = ./node_modules/.bin/watchify
|
|
|
|
WATCH = ./node_modules/.bin/watch
|
|
|
|
LESS = ./node_modules/.bin/lessc
|
|
|
|
BROWSERIFY = ./node_modules/.bin/browserify
|
|
|
|
UGLIFY = ./node_modules/.bin/uglifyjs
|
2016-01-21 22:57:53 +00:00
|
|
|
CLEANCSS = ./node_modules/.bin/cleancss
|
2016-01-12 13:55:48 +00:00
|
|
|
MOCHA = ./node_modules/.bin/mocha
|
2016-01-21 22:57:53 +00:00
|
|
|
SERVER = ./node_modules/.bin/superstatic
|
2016-01-12 13:55:48 +00:00
|
|
|
|
2016-01-21 22:57:53 +00:00
|
|
|
MOCHA-OPTS = --compilers js:babel-register --ui exports --timeout 5000 --bail
|
2016-01-12 13:55:48 +00:00
|
|
|
|
2016-01-21 22:57:53 +00:00
|
|
|
serve:
|
|
|
|
${SERVER} --port 8080
|
|
|
|
|
|
|
|
watch-js: build-js
|
|
|
|
${WATCHIFY} -e -s burnchart ./src/js/index.jsx -t babelify -o public/js/bundle.js -d -v
|
|
|
|
|
|
|
|
watch-css: build-css
|
2016-01-12 13:55:48 +00:00
|
|
|
${WATCH} "${MAKE} build-css" src/less
|
|
|
|
|
|
|
|
watch:
|
|
|
|
${MAKE} watch-js & ${MAKE} watch-css
|
|
|
|
|
|
|
|
build-js:
|
2016-01-21 22:57:53 +00:00
|
|
|
${BROWSERIFY} -e -s burnchart ./src/js/index.jsx -t babelify > public/js/bundle.js
|
2016-01-12 13:55:48 +00:00
|
|
|
|
|
|
|
build-css:
|
2016-01-12 14:14:19 +00:00
|
|
|
${LESS} src/less/burnchart.less > public/css/bundle.css
|
2016-01-12 13:55:48 +00:00
|
|
|
|
2016-01-21 22:57:53 +00:00
|
|
|
build: build-js build-css
|
|
|
|
|
|
|
|
minify-js:
|
|
|
|
${UGLIFY} public/js/bundle.js > public/js/bundle.min.js
|
|
|
|
|
|
|
|
minify-css:
|
|
|
|
${CLEANCSS} public/css/bundle.css > public/css/bundle.min.css
|
2016-01-12 13:55:48 +00:00
|
|
|
|
|
|
|
test:
|
2016-01-21 22:57:53 +00:00
|
|
|
${MOCHA} ${MOCHA-OPTS} --reporter spec
|
2016-01-12 13:55:48 +00:00
|
|
|
|
2016-01-21 22:57:53 +00:00
|
|
|
.PHONY: test
|