fix: append identifier before import

This commit is contained in:
Michael Brevard 2024-04-08 19:28:58 +03:00 committed by GitHub
parent 2236f78566
commit 36dc73152f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -75,8 +75,8 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
// Temporary hardcoded check to verify runtime functionality
if (name === 'DelayedWrapperTestComponent') {
imports.add(genImport(clientDelayedComponentRuntime, [{ name: 'createLazyIOClientPage' }]))
imports.add(`const ${identifier} = createLazyIOClientPage(${JSON.stringify(name)})`)
identifier += '_delayedIO'
imports.add(`const ${identifier} = createLazyIOClientPage(${JSON.stringify(name)})`)
} else {
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
identifier += '_lazy'