From 3b898dc78678c43984e005e6f38ada2aea8b0975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Wed, 14 Feb 2024 10:42:16 +0800 Subject: [PATCH] fix: add vue import maps for default import map --- src/store.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/store.ts b/src/store.ts index 556c7717..db8a7f54 100644 --- a/src/store.ts +++ b/src/store.ts @@ -18,7 +18,7 @@ import type { } from 'vue/compiler-sfc' import type { OutputModes } from './types' import type { editor } from 'monaco-editor-core' -import { type ImportMap, mergeImportMap } from './import-map' +import { type ImportMap, mergeImportMap, useVueImportMap } from './import-map' import welcomeSFCCode from './template/welcome.vue?raw' import newSFCCode from './template/new-sfc.vue?raw' @@ -35,7 +35,7 @@ export function useStore( welcomeSFC: welcomeSFCCode, newSFC: newSFCCode, }), - builtinImportMap = ref({}), + builtinImportMap = undefined!, // set later errors = ref([]), showOutput = ref(false), @@ -51,6 +51,7 @@ export function useStore( }: Partial = {}, serializedState?: string, ): ReplStore { + builtinImportMap ||= useVueImportMap().importMap const loading = ref(false) function applyBuiltinImportMap() {