For context, I'm using elderjs to deploy my site to a traditional server and Fleek, where the content is hosted on IPFS. Some IPFS gateways resolve IPNS through URLs such as https://ipfs.io/ipns/<url>, meaning if the CSS href is pointing to /_elderjs/assets/svelte-ddfc11db.css it attempts to read https://ipfs.io/_elderjs/assets/svelte-ddfc11db.css, which will fail. This just adds a check to see if serverPrefix is blank, in which case it does not use a leading /.
For context, I'm using elderjs to deploy my site to a traditional server and Fleek, where the content is hosted on IPFS. Some IPFS gateways resolve IPNS through URLs such as
https://ipfs.io/ipns/<url>
, meaning if the CSS href is pointing to/_elderjs/assets/svelte-ddfc11db.css
it attempts to readhttps://ipfs.io/_elderjs/assets/svelte-ddfc11db.css
, which will fail. This just adds a check to see if serverPrefix is blank, in which case it does not use a leading /.