Просмотр исходного кода

Fixed bad public path. Added uppy/plugins and uppy/core aliasing

Harry Hedger 9 лет назад
Родитель
Сommit
1db60b5c75

+ 7 - 7
website/src/examples/dragdrop/src/js/app.js

@@ -1,8 +1,8 @@
-import Uppy from '../../../../../../src/core';
-import { DragDrop, Tus10 } from '../../../../../../src/plugins';
+// // import Uppy from '../../../../../../src/core';
+// // import { DragDrop, Tus10 } from '../../../../../../src/plugins';
 
-const uppy = new Uppy({wait: false});
-const files = uppy
-  .use(DragDrop, {selector: '#upload-target'})
-  .use(Tus10, {endpoint: 'http://master.tus.io:8080'})
-  .run();
+// const uppy = new Uppy({wait: false});
+// const files = uppy
+//   .use(DragDrop, {selector: '#upload-target'})
+//   .use(Tus10, {endpoint: 'http://master.tus.io:8080'})
+//   .run();

+ 2 - 2
website/src/examples/dropbox/src/js/app.js

@@ -1,3 +1,3 @@
-import { DropboxPlugin } from '../../../../../../src/plugins'
+import { DropboxPlugin } from 'uppy/plugins';
 
-console.log('pizza');
+console.log(DropboxPlugin);

+ 7 - 7
website/src/examples/playground/src/js/app.js

@@ -1,8 +1,8 @@
-import Uppy from '../../../../src/core';
-import { DragDrop, Tus10 } from '../../../../src/plugins';
+// import Uppy from 'uppy/core';
+// import { DragDrop, Tus10 } from 'uppy/plugins';
 
-const uppy = new Uppy({wait: false});
-const files = uppy
-  .use(DragDrop, {selector: '#upload-target'})
-  .use(Tus10, {endpoint: 'http://master.tus.io:8080'})
-  .run();
+// const uppy = new Uppy({wait: false});
+// const files = uppy
+//   .use(DragDrop, {selector: '#upload-target'})
+//   .use(Tus10, {endpoint: 'http://master.tus.io:8080'})
+//   .run();

+ 9 - 3
website/watch.js

@@ -21,7 +21,11 @@ glob([pattern, 'website/' + pattern], function(err, files) {
       cache: {},
       packageCache: {},
       plugin: [watchify]
-    }).transform(babelify);
+    })
+      .require('../src/index.js', { expose: 'uppy' })
+      .require('../src/core/index.js', { expose: 'uppy/core' })
+      .require('../src/plugins/index.js', { expose: 'uppy/plugins' })
+      .transform(babelify);
 
     watcher
       .on('update', bundle)
@@ -38,9 +42,11 @@ glob([pattern, 'website/' + pattern], function(err, files) {
         console.log(chalk.cyan('change:'), chalk.bold(id[0]));
         mute = true;
       }
+
+      var output = file.replace(src, dest);
       var bundle = watcher.bundle();
-      bundle.pipe(createStream(file.replace(src, dest)));
-      bundle.pipe(createStream('public' + file.slice(3)));
+      bundle.pipe(createStream(output));
+      bundle.pipe(createStream(output.replace('src', 'public')));
     }
   });
 });