فهرست منبع

Attempting to build a playground example with Browserify & Babel

Artur Paikin 9 سال پیش
والد
کامیت
7ba8df8411
4فایلهای تغییر یافته به همراه21 افزوده شده و 5 حذف شده
  1. 8 1
      examples/buildAll
  2. 12 0
      examples/playground/src/js/app.js
  3. 0 3
      examples/playground/static/js/app.js
  4. 1 1
      package.json

+ 8 - 1
examples/buildAll

@@ -1 +1,8 @@
-./node_modules/.bin/browserify examples/playground/src/js/app.js -o examples/playground/static/js/app.js
+#!/bin/bash
+
+ENTRY=examples/playground/src/js/app.js
+OUTPUT=examples/playground/static/js/app.js
+TRANSFORMS="[ babelify ]"
+
+# Argument should be browserify or watchify
+$ENTRY -o $OUTPUT -t $TRANSFORMS

+ 12 - 0
examples/playground/src/js/app.js

@@ -0,0 +1,12 @@
+import Transloadit from '../../../src/js/core/Transloadit';
+import DragDrop from '../../../src/js/plugins/DragDrop';
+import Tus10 from '../../../src/js/plugins/Tus10';
+
+const transloadit = new Transloadit({wait: false});
+const files = transloadit
+  .use(DragDrop, {modal: true})
+  .use(Tus10, {endpoint: 'http://master.tus.io:8080'})
+  .run();
+
+console.log('--> Finished transloadit. Final result: ');
+console.dir(files);

+ 0 - 3
examples/playground/static/js/app.js

@@ -1,3 +0,0 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-
-},{}]},{},[1]);

+ 1 - 1
package.json

@@ -8,7 +8,7 @@
     "build": "npm run build:js && npm run build:css",
     "build:css": "bin/styles",
     "build:js": "bin/scripts node_modules/.bin/browserify",
-    "build:examples": "examples/buildAll",
+    "build:examples": "examples/buildAll node_modules/.bin/browserify",
     "clean": "rm -rf build/*.js && rm -rf build/*.css",
     "lint": "eslint src/js/lib/**/*.js",
     "phantom-test": "zuul test/spec/upload.js --phantom",