Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images are broken in dev mode #21

Open
rozbb opened this issue Sep 6, 2022 · 0 comments
Open

Images are broken in dev mode #21

rozbb opened this issue Sep 6, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@rozbb
Copy link
Owner

rozbb commented Sep 6, 2022

Running scripts/dev.sh (which calls trunk) runs a version of RTMS with broken images, broken content scripts, broken manifests, etc. This is because dev mode serves the index from /, while production serves all the static assets from /assets/ (aside from index.html, which is special-cased). So if I set the favicon URL to /assets/favicon.ico, then it'll load in prod mode but fail in dev mode. And if I set it to /favicon.ico it'll load in dev mode and fail in prod mode.

An obvious thing to try is to put everything inside an /assets folder in dev mode. But this doesn't work because 1) it needs to serve index.html from /, and 2) if you make index.html separate, and put everything else in /assets/, then the URLs in prod will be /assets/assets/, because Trunk doesn't distinguish dev and prod builds.

Another solution is to do the above, but also make a copy of every asset in / as well. But 1) Trunk doesn't have a notion of making 2 copies of everything (though maybe you could do this in post-build hooks, and 2) this is very ugly.

@rozbb rozbb added the bug Something isn't working label Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant