[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2024-04-08 14:22:13 +00:00 committed by GitHub
parent 20a32b2200
commit 816ba111b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,12 +73,11 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
if (lazy) {
// 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'
}
else {
if (name === 'DelayedWrapperTestComponent') {
imports.add(genImport(clientDelayedComponentRuntime, [{ name: 'createLazyIOClientPage' }]))
imports.add(`const ${identifier} = createLazyIOClientPage(${JSON.stringify(name)})`)
identifier += '_delayedIO'
} else {
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
identifier += '_lazy'
imports.add(`const ${identifier} = __defineAsyncComponent(${genDynamicImport(component.filePath, { interopDefault: false })}.then(c => c.${component.export ?? 'default'} || c)${isClientOnly ? '.then(c => createClientOnly(c))' : ''})`)