Skip to content

Commit 9e6f078

Browse files
committed
fix: don't re-create import map file
1 parent e5a0ad5 commit 9e6f078

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/store.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,13 @@ export function useStore(
137137
map.imports![key] = fixURL(value)
138138
}
139139
}
140-
files.value[importMapFile] = new File(
141-
importMapFile,
142-
JSON.stringify(map, undefined, 2),
143-
)
140+
141+
const code = JSON.stringify(map, undefined, 2)
142+
if (files.value[importMapFile]) {
143+
files.value[importMapFile].code = code
144+
} else {
145+
files.value[importMapFile] = new File(importMapFile, code)
146+
}
144147
}
145148

146149
const setActive: Store['setActive'] = (filename) => {

0 commit comments

Comments
 (0)