Skip to content

Instantly share code, notes, and snippets.

@thiagobraga
Last active May 17, 2019 17:03
Show Gist options
  • Save thiagobraga/0686eb0e39a088e9a6c21d5e5207fa98 to your computer and use it in GitHub Desktop.
Save thiagobraga/0686eb0e39a088e9a6c21d5e5207fa98 to your computer and use it in GitHub Desktop.
Makefile for compiling and watching sass files
PWD := $(shell pwd)
PATH := ${PWD}/node_modules/.bin:$(PATH)
.SILENT: build clean install release watch
all: install build watch
clean:
rm -rf dist/debug node_modules
install:
if [ ! -d node_modules ]; then npm ci; fi
build:
sass -s compressed --no-charset --no-source-map src/sass:dist/debug
css2userstyle --no-userscript dist/debug/theme.css
release:
sass -s compressed --no-charset --no-source-map src/sass:dist/release
postcss dist/release/theme.css --use autoprefixer cssnano --replace --no-map
css2userstyle --no-userscript dist/release/theme.css
watch:
chokidar src/sass -c 'make -s build' & \
browser-sync start --config bs-config.js & \
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment