Skip to content

Commit 7e7c7f9

Browse files
committed
fix: fix legacy domain in import maps
1 parent 2a3dc5e commit 7e7c7f9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/store.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,17 @@ export class ReplStore implements Store {
221221
const json = JSON.parse(map.code)
222222
if (!json.imports.vue) {
223223
json.imports.vue = this.defaultVueRuntimeURL
224-
map.code = JSON.stringify(json, null, 2)
224+
} else {
225+
json.imports.vue = fixURL(json.imports.vue)
225226
}
226227
if (!json.imports['vue/server-renderer']) {
227228
json.imports['vue/server-renderer'] = this.defaultVueServerRendererURL
228-
map.code = JSON.stringify(json, null, 2)
229+
} else {
230+
json.imports['vue/server-renderer'] = fixURL(
231+
json.imports['vue/server-renderer']
232+
)
229233
}
234+
map.code = JSON.stringify(json, null, 2)
230235
} catch (e) {}
231236
}
232237
}
@@ -282,3 +287,7 @@ export class ReplStore implements Store {
282287
console.info(`[@vue/repl] Now using default Vue version`)
283288
}
284289
}
290+
291+
function fixURL(url: string) {
292+
return url.replace('https://sfc.vuejs', 'https://play.vuejs')
293+
}

0 commit comments

Comments
 (0)