#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
# set -o xtrace

# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
__base="$(basename ${__file} .sh)"

SRC="src/index.js"
OUT="${OUT:-uppy.js}"
OUTDIR="dist"

FLAGS="-t [ babelify ] --standalone Uppy"

mkdir -p "${OUTDIR}"

browserify ${@:-} $SRC $FLAGS > $OUTDIR/$OUT
