Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2universalStack: Vite
assetscachingbundlerperformance
Import static assets from source so they get content-hashed
Place images and similar assets in src and import their URL so the bundler adds a content hash; reserve the public folder for files that must keep a fixed path (favicon, robots.txt).
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetsx
| 1 | // public/PhoneApp.png referenced by fixed path, no cache busting |
| 2 | <img src="/PhoneApp.png" /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | import phoneAppUrl from './PhoneApp.png'; |
| 2 | <img src={phoneAppUrl} /> |
Explanation (EN)
Objašnjenje (HR)