Merge pull request #313 from goto-bus-stop/feature/unpkg

Add `unpkg` to package.json
This commit is contained in:
Artur Paikin 2017-09-15 23:20:04 -04:00 committed by GitHub
commit eaa0a4a328
4 changed files with 9 additions and 8 deletions

View file

@ -47,7 +47,7 @@ If you like, you can also use a pre-built bundle, for example from [unpkg CDN](h
1\. Add a script to the bottom of `<body>`:
``` html
<script src="https://unpkg.com/uppy/dist/uppy.min.js"></script>
<script src="https://unpkg.com/uppy"></script>
```
2\. Add CSS to `<head>`:

View file

@ -4,6 +4,7 @@
"description": "Almost as cute as a Puppy :dog:",
"main": "lib/index.js",
"jsnext:main": "src/index.js",
"unpkg": "dist/uppy.min.js",
"files": [
"src/",
"lib/",

View file

@ -17,7 +17,7 @@ const Tus10 = require('uppy/lib/plugins/Tus10')
 
const uppy = Uppy({ autoProceed: false })
.use(Dashboard, {
trigger: '#select-files',
trigger: '#select-files',
replaceTargetContent: true
})
.use(Tus10, {endpoint: '//master.tus.io/files/'})
@ -30,7 +30,7 @@ uppy.on('core:success', (files) => {
[Try it live](/examples/dashboard/)
Drag and Drop, Webcam, basic file manipulation (adding metadata), uploading via tus resumable uploads or XHR/Multipart is all possible using just the uppy client module.
Drag and Drop, Webcam, basic file manipulation (adding metadata), uploading via tus resumable uploads or XHR/Multipart is all possible using just the uppy client module.
Adding [Uppy Server](/docs/server/) to the mix enables remote sources, such as Instagram, Google Drive and Dropbox. Uploads from remote sources are handled server-to-serber,(so a 5 GB video wont be eating into your mobile data plan. Files are removed from Uppy Server after an upload is complete, or after a reasonable timeout. Access tokens also dont stick around for long, for security reasons.
@ -40,16 +40,16 @@ Adding [Uppy Server](/docs/server/) to the mix enables remote sources, such as I
$ npm install uppy
```
We recommend installing from NPM and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
We recommend installing from NPM and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
If you like, you can also use a pre-built bundle, for example from [unpkg CDN](https://unpkg.com/uppy/). In that case `Uppy` will attach itself to the global `window.Uppy` object.
If you like, you can also use a pre-built bundle, for example from [unpkg CDN](https://unpkg.com/uppy/). In that case `Uppy` will attach itself to the global `window.Uppy` object.
> ⚠️ The bundle currently consists of most Uppy plugins, so this method is not recommended for production, as your users will have to download all plugins, even if you are using just a few.
1\. Add a script to the bottom of `<body>`:
``` html
<script src="https://unpkg.com/uppy/dist/uppy.min.js"></script>
<script src="https://unpkg.com/uppy"></script>
```
2\. Add CSS to `<head>`:

View file

@ -3,7 +3,7 @@
<div class="UppyDragDrop"></div>
<!-- Load Uppy pre-built bundled version. You can use a CDN: https://unpkg.com/uppy/dist/uppy.min.js -->
<!-- Load Uppy pre-built bundled version. You can use a CDN: https://unpkg.com/uppy -->
<script src="/uppy/uppy.min.js"></script>
<script>
var uppy = Uppy.Core({debug: true});
@ -12,7 +12,7 @@
locale: {
strings: {
chooseFile: 'Выберите файл',
orDragDrop: 'или перенесите его сюда'
orDragDrop: 'или перенесите его сюда'
}
}
});