In this project we build a worker file, that relies on methods from a large file transpiled (with TeaVM) from Java code. This has previously worked fine with esbuild and minification, but recent changes to the original Java code have caused the bundling to break, but only while using minification.
For a small sample that you can reproduce the issue in: clone this repo and run tester.js after building with the minification build script. See that it throws an error, but does not when building without minification.