12345678910111213141516171819202122232425262728293031323334353637 |
- #!/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)"
- __root="$(cd "$(dirname "${__dir}")" && pwd)"
- __e2eSuites="${__root}/test/endtoend"
- ESBUILD="$(corepack yarn workspace @uppy-tests/end2end bin esbuild)"
- for t in $(cd "$__e2eSuites" && ls -d */ | cut -f1 -d'/'); do
- if [ "$t" = "tmp" ]; then continue; fi
- if [ "$t" = "create-react-app" ]; then continue; fi
- mkdir -p "${__e2eSuites}/$t/dist"
- cp "${__root}/packages/uppy/dist/uppy.min.css" "${__e2eSuites}/$t/dist"
- cp "${__e2eSuites}/$t/index.html" "${__e2eSuites}/$t/dist"
- entryPointName="main.mjs"
- if [ "$t" = "typescript" ]; then entryPointName="main.ts"; fi
- "$ESBUILD" "${__e2eSuites}/$t/$entryPointName" \
- --bundle --target=es2017 \
- --outfile="${__e2eSuites}/$t/dist/bundle.js"
- done
- # Speeecial tests that need custom builds.
- pushd "${__e2eSuites}/create-react-app"
- npm install
- REACT_APP_ON_TRAVIS="${TRAVIS:-}" npm run build
- popd
|