Skip to content

Commit

Permalink
fix: don't re-create import map file
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jan 24, 2024
1 parent e5a0ad5 commit 9e6f078
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/store.ts
Expand Up @@ -137,10 +137,13 @@ export function useStore(
map.imports![key] = fixURL(value)
}
}
files.value[importMapFile] = new File(
importMapFile,
JSON.stringify(map, undefined, 2),
)

const code = JSON.stringify(map, undefined, 2)
if (files.value[importMapFile]) {
files.value[importMapFile].code = code
} else {
files.value[importMapFile] = new File(importMapFile, code)
}
}

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

0 comments on commit 9e6f078

Please sign in to comment.