-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed as not planned
Description
If a component is defined as an async component like this:
app.component('HelloWorld', defineAsyncComponent(() => import(/* webpackChunkName: "hello-world" */ './components/HelloWorld.vue')));
Component resources (js, css) are not included in the result of renderToString().preloadFiles()
.
Here is example: https://github.com/juvirez/test-async-components
It looks like here is the code responsible for this:
vue-bundle-renderer/src/renderer.ts
Lines 160 to 166 in d01cf4e
export function getUsedAsyncFiles (ssrContext: SSRContext, renderContext: RenderContext): Array<Resource> { | |
if (!ssrContext._mappedFiles && ssrContext._registeredComponents && renderContext.mapFiles) { | |
const registered = Array.from(ssrContext._registeredComponents) | |
ssrContext._mappedFiles = renderContext.mapFiles(registered).map(normalizeFile) | |
} | |
return ssrContext._mappedFiles || [] | |
} |
But in my case
_registeredComponents
is undefined. How can I define this variable for ssrContext?SyloRei and meteor-ec
Metadata
Metadata
Assignees
Labels
No labels