2016-03-15 12:05:11 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-08-17 15:15:09 -04:00
|
|
|
set -euo pipefail
|
|
|
|
#set -x
|
2016-03-15 12:05:11 -04:00
|
|
|
|
2016-08-17 15:15:09 -04:00
|
|
|
#trap 'kill $(jobs -p)' EXIT # IS THIS NECESSARY? on linux, it kills all child processes when you ctrl-c
|
2016-03-15 12:12:43 -04:00
|
|
|
|
2016-08-17 15:15:09 -04:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2017-06-05 12:29:17 -04:00
|
|
|
(
|
|
|
|
cd "$DIR"
|
|
|
|
mkdir -p $DIR/dist/css
|
|
|
|
mkdir -p $DIR/dist/js
|
2016-08-17 15:15:09 -04:00
|
|
|
|
2017-06-05 12:29:17 -04:00
|
|
|
if [ ! -d "$DIR/node_modules" ]; then
|
|
|
|
echo "Installing NPM modules"
|
2017-06-23 15:18:03 -04:00
|
|
|
yarn install
|
2017-06-05 12:29:17 -04:00
|
|
|
fi
|
2016-08-17 15:15:09 -04:00
|
|
|
|
2017-06-05 12:29:17 -04:00
|
|
|
# run sass once without --watch to force update. then run with --watch to keep watching
|
|
|
|
node_modules/.bin/node-sass --output $DIR/../app/dist/css --sourcemap=none $DIR/scss/
|
|
|
|
node_modules/.bin/node-sass --output $DIR/../app/dist/css --sourcemap=none --watch $DIR/scss/ &
|
2016-08-17 16:27:53 -04:00
|
|
|
|
2017-06-05 12:29:17 -04:00
|
|
|
node_modules/.bin/webpack --config webpack.dev.config.js --progress --colors --watch
|
|
|
|
)
|