Compare commits

...

2 Commits

Author SHA1 Message Date
50aa4c5d07 Merge pull request 'Fix HMR import.meta.hot for Bun static analysis' (#1) from probablycorey/forge:fix/hmr-static-analysis into main
Reviewed-on: #1
2026-01-21 00:02:47 +00:00
8484553029 Fix HMR import.meta.hot for Bun static analysis
Use direct conditional instead of optional chaining so Bun can
statically analyze and remove the HMR block in production builds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:46:15 -08:00

View File

@ -10,7 +10,9 @@ export function clearStyles() {
}
// HMR support - clear styles when module is replaced
import.meta.hot?.dispose(() => clearStyles())
if (import.meta.hot) {
import.meta.hot.dispose(() => clearStyles())
}
export function createTheme<const T extends Record<string, string | number>>(name: string, values: T): T {
themes[name] = values as Record<string, string | number>