1
Fork 0

Added conditional LESS builds for production

This commit is contained in:
Jake Howard 2016-01-14 19:12:23 +00:00
parent b5d937d9b9
commit bd4f020328
2 changed files with 18 additions and 1 deletions

View file

@ -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/",

17
scripts/build-less.sh Executable file
View file

@ -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