Browse Source

readme: Use new ESM syntax (#4028)

* Use new ESM syntax

* Update README.md

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Artur Paikin 2 years ago
parent
commit
bbcc14687c
1 changed files with 7 additions and 10 deletions
  1. 7 10
      README.md

+ 7 - 10
README.md

@@ -78,14 +78,15 @@ Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Edg
 <link href="https://releases.transloadit.com/uppy/v3.0.0-beta.5/uppy.min.css" rel="stylesheet">
 
 <!-- 2. Add JS before the closing `</body>` -->
-<script src="https://releases.transloadit.com/uppy/v3.0.0-beta.5/uppy.min.js"></script>
 
 <!-- 3. Initialize -->
-<div class="UppyDragDrop"></div>
-<script>
-  var uppy = new Uppy.Core()
-  uppy.use(Uppy.DragDrop, { target: '.UppyDragDrop' })
-  uppy.use(Uppy.Tus, { endpoint: '//tusd.tusdemo.net/files/' })
+<div id="files-drag-drop"></div>
+<script type="module">
+  import { Uppy, Dashboard, Tus } from "https://releases.transloadit.com/uppy/v3.0.0-beta.5/uppy.min.mjs"
+
+  const uppy = new Uppy()
+  uppy.use(Dashboard, { target: '#files-drag-drop' })
+  uppy.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
 </script>
 ```
 
@@ -211,10 +212,6 @@ Transloadit’s team is small and we have a shared ambition to make a living fro
 
 Our thinking is that if only a fraction of our open source userbase can see the appeal of hosted versions straight from the source, that could already be enough to sustain our work. So far this is working out! We’re able to dedicate 80% of our time to open source and haven’t gone bankrupt yet. :D
 
-### Does Uppy support React?
-
-Yep, we have Uppy React components, please see [Uppy React docs](https://uppy.io/docs/react/).
-
 ### Does Uppy support S3 uploads?
 
 Yes, please check out the [docs](https://uppy.io/docs/aws-s3/) for more information.