-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.sh
executable file
·32 lines (24 loc) · 920 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
echo "Building project..."
BUILDPATH=./build
mkdir $BUILDPATH
echo "Copying files..."
cp -R ./src/* $BUILDPATH/
echo "Compiling..."
sass --no-source-map ./src/common/nav.scss:./build/common/nav.css
rm ./build/common/nav.css.map
rm ./build/common/nav.scss
rm -rf ./build/common/components
for file in $( find src -type f -name "*.html"); do
html-minifier $file --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js > $BUILDPATH/${file#*src/} &&
echo "+"${file#*src/} &
done
for file in $( find src -type f -name "*.css"); do
cleancss -o $BUILDPATH/${file#*src/} $file &&
echo "+"${file#*src/} &
done
for file in $( find src -type f -name "*.js"); do
uglifyjs $file -c -o $BUILDPATH/${file#*src/} &&
echo "+"${file#*src/} &
done
wait;
echo "Build complete"