forked from NSS-Cohort-9/ghpages-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·36 lines (30 loc) · 800 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
33
34
35
36
#!/bin/sh
# clean and prepare public directory
rm -rf public
cp -r src public
# compile jade to html
./node_modules/.bin/jade src -P
cd src
find . -name "*.html" | cpio -pdvm ../public
cd ..
rm -rf src/*.html \
src/**/*.html \
public/_partials \
public/**/_*html
#compile sass to css
./node_modules/.bin/node-sass \
--output-style compressed \
--source-map-embed \
src/_styles/main.scss public/css/main.css
#convert ES6 JS to ES5
./node_modules/.bin/babel src --out-dir public -s inline
# concat bower_components to public/lib directory
if [ -d "bower_components" ]; then
./node_modules/.bin/bowcat . -o public/lib -m
fi
# clean unneeded files
rm -rf public/_styles \
public/*.jade \
public/**/*.jade \
public/*.scss \
public/**/*.scss