Skip to content

Instantly share code, notes, and snippets.

@ds0nt
Created March 29, 2016 05:00
Show Gist options
  • Save ds0nt/08499a61ccbe44a74ae7 to your computer and use it in GitHub Desktop.
Save ds0nt/08499a61ccbe44a74ae7 to your computer and use it in GitHub Desktop.
#!/bin/bash
trap killgroup SIGINT
killgroup(){
echo "killing..."
kill 0
}
[ -d 'dist' ] || mkdir -p 'dist'
if [[ "${NODE_ENV}" == "production" ]]; then
cp -urv public/* dist/
browserify -g uglifyify -e src/app.js -t babelify | uglifyjs -c > dist/app.js
myth styles/app.css dist/app.css
else
watchman public 'cp -urv public/* dist/' &
watchman src 'browserify -d -e src/app.js -t babelify -o dist/app.js' &
watchman styles 'myth styles/app.css dist/app.css' &
fi
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment