I understand your project's constraints. I meant that you could try compiling and running the mongoose server linked against the packed filesystem in your development machine.
It seems to me that the problem would be caused by Mongoose packing, rather than vite/rollup's build, since it seems to run fine on your development environment.
PS: Could you try reproducing the Problem using a mongoose server running on your development machine, or even better: on a Dockerfile?
Then you could share a minimal example that could help to further diagnose the issue.
Tip: Both GDM and SDDM have startup scripts that are executed when X is initiated. For GDM, these are in /etc/gdm/, while for SDDM this is done at /usr/share/sddm/scripts/Xsetup. This method requires root access and mucking around in system configuration files, but will take effect earlier in the startup process than using xprofile.
Mount the drive with the user or group as plex. See mount options uid and gid. You can also set precise permissions on the mount point (using options at mount time) to let plex access a subdirectory.
Nginx is pretty easy to set up. Look up "nginx virtual hosts". You might want to use certbot/acme if you don't have SSL certificates for your domain names. You need either a wildcard certificate (*.example.com), a certificate with SAN (Subject Alternative Name) containing the second subdomain, or two certificates (one for each subdomain).
Note that subdomains can be found more easily than path based websites, if you allow connections from the whole WAN.
In French, oursin (urchin) seems to be the diminutive of ours, which means bear. So oursin means something like "little bear".