From db672cf662d014a2c6286fa31a0d976c55ccfe7e Mon Sep 17 00:00:00 2001 From: Puru Vijay Date: Wed, 29 Mar 2023 14:52:25 +0530 Subject: [PATCH] Refactor --- sites/svelte.dev/svelte.config.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sites/svelte.dev/svelte.config.js b/sites/svelte.dev/svelte.config.js index efd62e2289..259b973ff9 100644 --- a/sites/svelte.dev/svelte.config.js +++ b/sites/svelte.dev/svelte.config.js @@ -12,12 +12,13 @@ export default { prerender: { // TODO: REMOVE handleMissingId: 'ignore', - entries: [ - '*', - ...get_tutorial_list(get_tutorial_data()).flatMap(({ tutorials }) => - tutorials.map((tutorial) => /** @type {`/${string}`} */ ('/tutorial/' + tutorial.slug)) - ), - ], + entries: ['*', ...tutorial_entries()], }, }, }; + +function tutorial_entries() { + return get_tutorial_list(get_tutorial_data()).flatMap(({ tutorials }) => + tutorials.map((tutorial) => /** @type {`/${string}`} */ ('/tutorial/' + tutorial.slug)) + ); +}