We already employ ESBuild in creating the bundle for our tests, which gets us in the strange situation where the testing of the bundle is happening on a version that we never produce 🤡
Most of the work is already done in the coverage.cjs script, so it's mostly just about extracting that chunk and re-using it everywhere else (NPM scripts, bundle, coverage, ...).