On-chain assets need to have their path specified such that they are URL-resolvable.
Currently <script src="assets/index.js" /> works as a reference to /author.near/assets.index.js, ostensibly due to URL hierarchy rules. However the same code with a leading / (src="/assets/index.js") fails since the path is relative to the domain, and ends up omitting the author.near/ prefix.
Truncating the leading / could be a viable option here, though the same logic would need to be applied within bundles; i.e. when a bundle references a relative svg path.
This all assumes that all assets are going on-chain. Differentiating on-chain vs externally-hosted assets is a separate issue 😅
On-chain assets need to have their path specified such that they are URL-resolvable.
Currently
<script src="assets/index.js" />
works as a reference to/author.near/assets.index.js
, ostensibly due to URL hierarchy rules. However the same code with a leading/
(src="/assets/index.js"
) fails since the path is relative to the domain, and ends up omitting theauthor.near/
prefix.Truncating the leading
/
could be a viable option here, though the same logic would need to be applied within bundles; i.e. when a bundle references a relative svg path.This all assumes that all assets are going on-chain. Differentiating on-chain vs externally-hosted assets is a separate issue 😅