Context
During the portfolio build, I noticed that different projects use different conventions for static assets — and that the wrong choice can cause production-only path issues.
Decisions
- Use
src/assetsfor imported assets
Assets referenced from JS/CSS should be processed by Vite and get cache-friendly file names. - Use
public/only for fixed URLs
Anything that must exist at an exact URL (e.g.robots.txt) belongs inpublic/.
Implementation notes
- Prefer build-safe references like
new URL("./path", import.meta.url)where appropriate. - Keep asset naming consistent across projects (especially screenshots and thumbnails).
- Avoid mixing “absolute” and “relative” URL strategies without a clear rule.
Lessons learned
A small convention early prevents lots of “why does this only break on the VPS?” debugging later.
Links
- Repo: (private)