Extensions are now able to require external libraries via await import. When the gallery starts, it downloads all dependencies (via acorn parser) and replace their URLs with downloaded data URLs.
Example code:
(async function (Scratch) {
// Dynamic URLs are not supported.
const editor = await import('https://cdn.jsdelivr.com/...');
})(Scratch);
After processing:
(async function (Scratch) {
const editor = await import('data:text/javascript;base64,...');
})(Scratch);
There will be a cache directory to store downloaded dependencies so that you do not need to download them twice.