mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): send the component loader and not the name
This commit is contained in:
parent
d4bca6cd57
commit
b3250e4a46
@ -74,9 +74,10 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
|
|||||||
if (lazy) {
|
if (lazy) {
|
||||||
// Temporary hardcoded check to verify runtime functionality
|
// Temporary hardcoded check to verify runtime functionality
|
||||||
if (name === 'DelayedWrapperTestComponent') {
|
if (name === 'DelayedWrapperTestComponent') {
|
||||||
|
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
|
||||||
imports.add(genImport(clientDelayedComponentRuntime, [{ name: 'createLazyIOClientPage' }]))
|
imports.add(genImport(clientDelayedComponentRuntime, [{ name: 'createLazyIOClientPage' }]))
|
||||||
identifier += '_delayedIO'
|
identifier += '_delayedIO'
|
||||||
imports.add(`const ${identifier} = createLazyIOClientPage(${JSON.stringify(name)})`)
|
imports.add(`const ${identifier} = createLazyIOClientPage(__defineAsyncComponent(${genDynamicImport(component.filePath)}))`)
|
||||||
} else {
|
} else {
|
||||||
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
|
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
|
||||||
identifier += '_lazy'
|
identifier += '_lazy'
|
||||||
|
Loading…
Reference in New Issue
Block a user