Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dragdrop' into dragdrop

Conflicts:
	src/plugins/DragDrop.js
Artur Paikin 9 anni fa
parent
commit
1d1f88e7c8
2 ha cambiato i file con 62 aggiunte e 0 eliminazioni
  1. 1 0
      .gitignore
  2. 61 0
      bin/builder

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@
 Thumbs.db
 npm-debug.log
 node_modules
+
 dist/
 lib/
 examples/playground/static/js/app.js

+ 61 - 0
bin/builder

@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# Setup
+#######################################################
+transformations="[ babelify ]"
+toolpath="${1:-node_modules/.bin/browserify}"
+toolname="$(basename "${toolpath}")"
+
+if [ "${toolname}" = "node-sass" ]; then
+  srcExtension="scss"
+  dstExtension="css"
+else
+  srcExtension="js"
+  dstExtension="js"
+fi
+
+if [ "${toolname}" = "watchify" ]; then
+  extraArgs="-t ${transformations} --ignore-watch=**/build/** --verbose"
+elif [ "${toolname}" = "browserify" ]; then
+  extraArgs="-t ${transformations} --ignore-watch=**/build/** --verbose"
+else
+  extraArgs=""
+fi
+
+
+bundleTarget="build/uppy.${dstExtension}"
+
+# Individual files, built seperately
+#######################################################
+allSourceFiles=""
+for src in $(find src -name "*.${srcExtension}" -type f); do
+  allSourceFiles="${allSourceFiles} ${src}"
+  dst="build/$(basename $(dirname ${src}))/$(basename ${src})"
+  echo "--> ${src} -> ${dst}"
+
+  # Argument should be `browserify`, or `node-sass`
+  if [ "${toolname}" = "node-sass" ]; then
+    "${toolpath}" "${src}" "${dst}" ${extraArgs}
+  else
+    "${toolpath}" "${src}" -o "${dst}" ${extraArgs}
+  fi
+done
+
+# All files in one bundle
+#######################################################
+echo "--> *.${srcExtension} -> ${bundleTarget}"
+if [ "${toolname}" = "node-sass" ]; then
+  "${toolpath}" ${allSourceFiles} "${bundleTarget}" ${extraArgs}
+else
+  "${toolpath}" ${allSourceFiles} -o "${bundleTarget}" ${extraArgs}
+fi
+
+# Install into examples
+for path in $(find examples -maxdepth 1 -mindepth 1 -type d); do
+  exampleProject="$(basename "${path}")"
+  rsync \
+    -ai \
+    --exclude='.DS_Store' \
+    --exclude='.empty' \
+  build/ "examples/${exampleProject}/static/uppy"
+done