I am following the instructions to import uppy into my current system. However, after npm install @uppy/core @uppy/xhr-upload @uppy/dashboard
, I don’t know where to import those plugins. i.e. I don’t know where to use those following code:
Can anyone help me out? Thanks, currently my system uses webpack as module bundler.
// Import the plugins
const Uppy = require('@uppy/core')
const XHRUpload = require('@uppy/xhr-upload')
const Dashboard = require('@uppy/dashboard')
// And their styles (for UI plugins)
require('@uppy/core/dist/style.css')
require('@uppy/dashboard/dist/style.css')
const uppy = Uppy()
.use(Dashboard, {
trigger: '#select-files'
})
.use(XHRUpload, { endpoint: 'https://api2.transloadit.com' })
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful)
})```