-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwatch
More file actions
executable file
·18 lines (16 loc) · 784 Bytes
/
watch
File metadata and controls
executable file
·18 lines (16 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#try running: npm install -g watchify browser-sync babel-cli uglify-js
echo "Building Handler..."
mkdir -p dist && \
(while inotifywait -qe modify src/style.less
do
lessc src/style.less src/style.css
done) &
(babel --presets es2015 --source-type 'module' --watch src --out-dir .transpiled & \
(sleep 5 && \
(tee >(read && browser-sync start --server --files "*.html|dist/*.js") \
< <( \
# (watchify .transpiled/handlers/custom/index.js -o '> dist/handler.min.js && echo "Built handler.js"' -v) & \
(watchify .transpiled/handlers/custom/index.js -o 'uglifyjs -cm > dist/handler.min.js && echo "Built handler.js"' -v) & \
(watchify .transpiled/ui/index.js -o '> dist/ui.js && echo "Built ui.js"' -v) \
))))