diff --git a/src/index.tsx b/src/index.tsx index acb1b8f..d5751ce 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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>(name: string, values: T): T { themes[name] = values as Record