diff --git a/package.json b/package.json index 9a7fd10..f20f737 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build-js": "./scripts/build-js.sh", "create-build-dirs": "mkdir -p static/build/js/lib static/build/fonts static/build/css static/build/img", "build": "npm run create-build-dirs && npm run build-fonts && npm run build-images && npm run build-js && npm run build-less", - "build-less": "lessc --silent static/src/less/style.less static/build/css/style.css && cleancss -d --s0 -o static/build/css/style.css static/build/css/style.css", + "build-less": "./scripts/build-less.sh", "build-fonts": "cp -R node_modules/bootstrap/dist/fonts static/build/ && cp -R node_modules/ionicons/fonts static/build/ ", "build-images": "cp -r static/src/img/* static/build/img/", "watch-less": "watch 'npm run build-less' static/src/less/", diff --git a/scripts/build-less.sh b/scripts/build-less.sh new file mode 100755 index 0000000..9b0f06b --- /dev/null +++ b/scripts/build-less.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +if [[ $@ == **prod** ]] +then + echo ">>> WARNING: Building in Production Mode!" +fi + +echo ">> Building LESS..." +lessc --silent static/src/less/style.less static/build/css/style.css + +if [[ $@ == **prod** ]] +then + echo ">> Compressing LESS..." + cleancss -d --s0 -o static/build/css/style.css static/build/css/style.css +fi