Skip to content

Commit be89a4e

Browse files
committed
chore(playground): force recompile main.ts on theme toggle
The REPL only auto-compiles the active file. Explicitly call compileFile after updating main.ts so the preview picks up the new theme regardless of which file is active.
1 parent c715011 commit be89a4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/playground/src/composables/usePlaygroundFiles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { debounce, useTheme } from '@vuetify/v0'
55
import { decodePlaygroundHash, encodePlaygroundHash } from '@/composables/usePlayground'
66

77
// Utilities
8-
import { useStore, useVueImportMap } from '@vue/repl/core'
8+
import { compileFile, useStore, useVueImportMap } from '@vue/repl/core'
99
import { computed, onMounted, shallowRef, watch, watchEffect } from 'vue'
1010

1111
// Data
@@ -141,6 +141,7 @@ export function usePlaygroundFiles () {
141141
const file = store.files['src/main.ts']
142142
if (file) {
143143
file.code = createMainTs(isDark ? 'dark' : 'light')
144+
compileFile(store, file)
144145
}
145146
})
146147

0 commit comments

Comments
 (0)