endtoend-build 886 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. echo "Preparing for end to end test: copying static HTML and CSS, building JS"
  3. rm -rf ./test/endtoend/dist && mkdir ./test/endtoend/dist
  4. rm -rf ./test/endtoend/node_modules
  5. npm run prepublishOnly
  6. # archive the uppy package
  7. echo "Creating archive for Uppy package"
  8. npm pack
  9. UPPY_VERSION=$(node -e 'console.log(require("./package.json").version)')
  10. # install from the archived uppy package
  11. echo "Installing Uppy from archived file uppy-${UPPY_VERSION}.tgz"
  12. npm install --prefix ./test/endtoend uppy-${UPPY_VERSION}.tgz
  13. # removing package-lock.json because we do not need it.
  14. rm ./test/endtoend/package-lock.json
  15. cp ./test/endtoend/node_modules/uppy/dist/uppy.min.css ./test/endtoend/dist
  16. cp ./test/endtoend/src/index.html ./test/endtoend/dist
  17. browserify ./test/endtoend/src/main.js -o ./test/endtoend/dist/bundle.js -t babelify
  18. rm -rf ./test/endtoend/node_modules