forked from NSS-Cohort-9/firebase-auth-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwatch.sh
executable file
·44 lines (36 loc) · 1.15 KB
/
watch.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
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
npm install
bower install
# clean and prepare public directory
rm -rf public
cp -r src public
# compile jade to html
./node_modules/.bin/nodemon -e jade --watch src --exec "
./node_modules/.bin/jade src -o public -PH
rm -rf src/*.html public/_partials" &
# compile sass to css
./node_modules/.bin/node-sass \
--output-style compressed \
--source-map-embed \
--recursive \
src/_styles/main.scss public/css/main.css &
# convert ES6 JS to ES5
./node_modules/.bin/babel \
src \
--out-dir public \
-s inline \
-w &
# concat bower_components to public/lib directory
if [ -d "bower_components" ]; then
./node_modules/.bin/bowcat . -o public/lib -m
fi
echo "clean"
# clean unneeded files
rm -rf public/_styles \
public/*.jade \
public/**/*.jade \
public/*.scss \
public/**/*.scss
echo "╔═══════════════════════════════════════════╗"
echo "║ Watching for changes... ║"
echo "╚═══════════════════════════════════════════╝"