I did experience the same issue. For Uppy 2.x I used Browserify to compile a bundle with @uppy/core, @uppy/xhr-upload, @uppy/status-bar, @uppy/file-input and @uppy/drag-drop only. If one’s not very familiar with Node.js and JavaScript bundlers such as rollup, you end up with many open questions.
After three days of trial and error, finally I got a working result using the Node.js version of Uppy, NPM and Webpack.
First create a folder and install the Node.js-version of Uppy and a few tools via NPM.
npm install @uppy/core
npm install --save-dev webpack style-loader css-loader
In the same folder, create a file webpack.config.js and add:
{
"name": "uppy test",
"version": "3.2.2",
"description": "",
"main": "src/index.js",
"private": false,
"scripts": {},
"keywords": [],
"author": "",
"license": "GPLv3",
"devDependencies": {
"css-loader": "^6.7.1",
"style-loader": "^3.3.1",
"webpack": "^5.38.1",
"webpack-cli": "^4.10.0"
},
"module": {
"exports": {
"mode": "production"
}
},
"dependencies": {
"@uppy/core": "^3.0.4",
}
}
Create a folder “src” and insert a file index.js with following content:
import { Uppy } from '@uppy/core'
import '@uppy/core/dist/style.css'
// you can call it
window.Uppy = Uppy
Create another folder “dist”.
Finally, call “npx webpack” and you’ll find a file uppy.min.js in the dist folder which is ready to use (in case I did not miss anything).