import { getDefaultModule } from './base';
export class RendererParser {
    onStart(context) {
        this.renderer = {};
    }
    parseModule(pageId, mod) {
        var _a;
        if (mod.name === '____index____')
            return;
        const [, , folder] = (_a = mod.path) === null || _a === void 0 ? void 0 : _a.split('/');
        if (folder) {
            this.renderer[pageId] = this.renderer[pageId] || {};
            this.renderer[pageId][folder] = getDefaultModule(mod.exports);
        }
        else
            this.renderer[pageId] = getDefaultModule(mod.exports);
    }
    onEnd(context) {
        context.renderer = this.renderer;
    }
}
