Explorar o código

Modified build system. Added dist build script

Harry Hedger %!s(int64=9) %!d(string=hai) anos
pai
achega
40d50b58ec
Modificáronse 7 ficheiros con 35 adicións e 12 borrados
  1. 1 1
      .gitignore
  2. 15 0
      bin/build
  3. 1 0
      core.js
  4. 1 1
      examples/playground/src/js/app.js
  5. 4 0
      index.js
  6. 4 7
      src/index.js
  7. 9 3
      src/plugins/index.js

+ 1 - 1
.gitignore

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

+ 15 - 0
bin/build

@@ -0,0 +1,15 @@
+CORESRC="src/core/index.js"
+COREDIST="dist/uppy.js"
+
+PLUGINSRC="src/plugins/index.js"
+PLUGINDIST="dist/uppy-plugins.js"
+
+CORENAME="Uppy"
+PLUGINNAME="UppyPlugin"
+
+TRANSFORMS="[ babelify ]"
+
+rm -rf dist
+mkdir dist
+browserify $CORESRC -o $COREDIST --standalone $CORENAME -t $TRANSFORMS
+browserify $PLUGINSRC -o $PLUGINDIST --standalone $PLUGINNAME -t $TRANSFORMS

+ 1 - 0
core.js

@@ -0,0 +1 @@
+module.exports = require('./lib/core')

+ 1 - 1
examples/playground/src/js/app.js

@@ -1,4 +1,4 @@
-import Transloadit from '../../../../Transloadit';
+import Transloadit from '../../../../core';
 import { DragDrop, Tus10 } from '../../../../plugins';
 
 const transloadit = new Transloadit({wait: false});

+ 4 - 0
index.js

@@ -0,0 +1,4 @@
+module.exports = {
+  core: require('./core'),
+  plugins: require('./plugins')
+}

+ 4 - 7
src/index.js

@@ -1,15 +1,12 @@
 import Core from './core'
 import {
   DragDrop,
-  UppyBasic,
+  TransloaditBasic,
   Tus10
 } from './plugins'
 
 import createUppy from './create'
 
-export default {
-  DragDrop,
-  TransloaditBasic,
-  Tus10,
-  createUppy
-}
+var uppy = createUppy();
+
+export default uppy

+ 9 - 3
src/plugins/index.js

@@ -1,3 +1,9 @@
-export DragDrop from './DragDrop'
-export TransloaditBasic from './TransloaditBasic'
-export Tus10 from './Tus10'
+import DragDrop from './DragDrop'
+import TransloaditBasic from './TransloaditBasic'
+import Tus10 from './Tus10'
+
+export default {
+  DragDrop,
+  TransloaditBasic,
+  Tus10
+}