Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed May 23, 2023
1 parent fa041a9 commit 5b84d80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions packages/astro/src/core/build/plugins/plugin-pages.ts
Expand Up @@ -26,9 +26,9 @@ function vitePluginPages(opts: StaticBuildOptions, internals: BuildInternals): V
async load(id) {
if (id === resolvedPagesVirtualModuleId) {
let importMap = '';
const imports = [];
const exports = [];
const content = [];
const imports: string[] = [];
const exports: string[] = [];
const content: string[] = [];
let i = 0;
imports.push(`import { renderers } from "${RENDERERS_MODULE_ID}"`);
exports.push(`export { renderers }`);
Expand All @@ -48,8 +48,7 @@ function vitePluginPages(opts: StaticBuildOptions, internals: BuildInternals): V

content.push(`export const pageMap = new Map([${importMap}]);`);

const result = [imports.join('\n'), content.join('\n'), exports.join('\n')];
return result.join('\n');
return `${imports.join('\n')}${content.join('\n')}${exports.join('\n')}`;
}
},
};
Expand Down
4 changes: 1 addition & 3 deletions packages/astro/src/core/build/plugins/plugin-renderers.ts
Expand Up @@ -42,9 +42,7 @@ export function vitePluginRenderers(

exports.push(`export const renderers = [${rendererItems}];`);

const result = [imports.join('\n'), exports.join('\n')];

return result.join('\n');
return `${imports.join('\n')}\n${exports.join('\n')}`;
}
}
},
Expand Down

0 comments on commit 5b84d80

Please sign in to comment.