diff --git a/lib/runtime/Instance/RNodeRuntime.js b/lib/runtime/Instance/RNodeRuntime.js index d6ca4dd7..42870be3 100644 --- a/lib/runtime/Instance/RNodeRuntime.js +++ b/lib/runtime/Instance/RNodeRuntime.js @@ -70,7 +70,11 @@ export class RNodeRuntime extends RNode { async loadModule() { if (!this.module && this.asyncModule) { - this.module = await this.asyncModule() + let childPromises = [] + // if bundling or SSR, load children too + if (this.meta.bundle || typeof window === 'undefined') + childPromises = this.children.map(c => c.loadModule()) + ;[this.module] = await Promise.all([this.asyncModule(), ...childPromises]) } return this.module }