I've been thinking this directive, including (linking/embedding) resources to pas2js units.
{$R projZipSprite.res}Of course it is a blue dream, after the .RES file is linked to the pas2js "executable" file, the application can load its resources at run time as needed. Actually use the resource, you'll have to make a few calls.
This ProjZipSprite uses a slight modification of the lib zipsprite from (https://github.com/Prinzhorn/zipsprite) to work in pas2js.
If you don't know, "ZipSprite" is a general purpose library to use uncompressed zip files as a container format in the browser. ZipSprite can be used to reduce HTTP requests whether you're creating a game, a multimedia interactive or an app. For example if your game needs a set of asset (like five images, three audio files and nine models) ASAP before it can load you can bundle these assets into one zip and then use ZipSprite to use them like they would be separate files.
In this prototype project, I load the projZipSprite.res, which is actually an uncompressed zip file.
live preview: https://pas2js.github.io/master/projZipSprite/index.html project download: https://pas2js.github.io/master/projZipSprite.rar
