uppy/examples/dev/index.js
Antoine du Hamel c315329399
Remove IE polyfills and special casing (#2947)
* Remove IE polyfills and special casing

* dashboard: remove `resize-observer-polyfill`

* deps: remove url-parse to use global `URL` instead

* Update documentation for browser support

* Add a migration guide

* Update e2e test platforms

* Remove polyfills from examples and add those missing in CDN bundle

* Use Node.js v16.x on CI because of `AbortController`

* Update bundle builder to produce two builds: `uppy.js` without polyfills, `uppy.legacy.js` with polyfills.

* Upgrade create-react-app deps

* remove null coalescing operator as it's not supported by the build chain

* disable Safari testing (for now)


Co-authored-by: Renée Kooi <renee@kooi.me>
2021-06-28 11:34:51 +02:00

20 lines
587 B
JavaScript

const DragDrop = require('./DragDrop.js')
const Dashboard = require('./Dashboard.js')
switch (window.location.pathname.toLowerCase()) {
case '/':
case '/dashboard.html': Dashboard(); break
case '/dragdrop.html': DragDrop(); break
}
if ('serviceWorker' in navigator) {
// eslint-disable-next-line compat/compat
navigator.serviceWorker
.register('/sw.js')
.then((registration) => {
console.log('ServiceWorker registration successful with scope: ', registration.scope)
})
.catch((error) => {
console.log(`Registration failed with ${error}`)
})
}