Skip to content

Instantly share code, notes, and snippets.

@bpierre
Created July 27, 2014 20:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpierre/da5283f34a03b26e2833 to your computer and use it in GitHub Desktop.
Save bpierre/da5283f34a03b26e2833 to your computer and use it in GitHub Desktop.
BIN=./node_modules/.bin
STYLUS=$(BIN)/stylus --include ./css --include ./node_modules/nib/lib --include-css
STYL_FILE=./css/index.styl
all: js css
deps:
npm install
if [ ! -f config.js ]; then cp config-example.js config.js; fi
js:
$(BIN)/browserify -t brfs src/index.js > dist/bundle.js
watch_js:
$(BIN)/watchify -t brfs src/index.js -o dist/bundle.js
css:
$(STYLUS) < $(STYL_FILE) > dist/bundle.css
watch_css:
$(STYLUS) --watch < $(STYL_FILE) > dist/bundle.css
dist:
$(BIN)/browserify -t brfs src/index.js | $(BIN)/uglifyjs --compress --mangle --screw-ie8 > dist/bundle.js
$(STYLUS) --compress < $(STYL_FILE) > dist/bundle.css
test:
npm test
cover:
npm run cover
pictos:
mkdir -p dist/icons
rm -f dist/icons/*.svg
./node_modules/.bin/fontello-svg \
--config fontello-config.json \
--out dist/icons \
--fill-colors "blue: rgb(32, 55, 107) | white: rgb(238, 238, 238) | grey: rgb(153, 153, 153) | purple: rgb(95, 40, 98)" \
--css-path "icons/"
.PHONY: all deps js css dist watch_js watch_css test cover pictos
BROWSERIFY=./node_modules/.bin/browserify
TESTLING=./node_modules/.bin/testling
test:
npm test | faucet
example:
$(BROWSERIFY) example/index.js > example/bundle.js
interactive_test:
$(BROWSERIFY) test/index.js | $(TESTLING) -u
.PHONY: example test interactive_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment