Skip to content

Commit 7b74ea5

Browse files
committed
fix: recompile all files when compiler changes
1 parent b85ec7d commit 7b74ea5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/store.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ export function useStore(
107107
{ immediate: true },
108108
)
109109

110+
// recompile all files when compiler changes
111+
watch(compiler, (_, oldCompiler) => {
112+
// skip initial (oldCompiler is undefined on first run)
113+
if (!oldCompiler) return
114+
for (const file of Object.values(files.value)) {
115+
compileFile(store, file)
116+
}
117+
})
118+
110119
watch(
111120
sfcOptions,
112121
() => {

0 commit comments

Comments
 (0)