Skip to content

Commit 4676e51

Browse files
committed
refactor(studio): dynamic import
1 parent b49f1d0 commit 4676e51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/runtime/plugins/studio/preview.client.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { mountPreviewUI, initIframeCommunication } from '../../internal/studio'
21
import { defineNuxtPlugin, useCookie, useRoute, useRuntimeConfig } from '#imports'
32

43
export default defineNuxtPlugin(async (nuxtApp) => {
@@ -24,8 +23,10 @@ export default defineNuxtPlugin(async (nuxtApp) => {
2423
window.sessionStorage.setItem('previewAPI', typeof route.query.staging !== 'undefined' ? 'https://dev-api.nuxt.studio' : studioConfig.apiURL)
2524

2625
nuxtApp.hook('app:mounted', async () => {
27-
mountPreviewUI()
28-
initIframeCommunication()
26+
await import('../../internal/studio').then(({ mountPreviewUI, initIframeCommunication }) => {
27+
mountPreviewUI()
28+
initIframeCommunication()
29+
})
2930
})
3031
}
3132
})

src/utils/schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z, type ZodRawShape } from 'zod'
1+
import { z } from 'zod'
22
import { ContentFileExtension } from '../types/content'
33
import { getEnumValues } from './zod'
44

0 commit comments

Comments
 (0)