From a12b34d28fbfaddd85d1171ee7e1d0ecebd01108 Mon Sep 17 00:00:00 2001 From: Chris Snowden Date: Tue, 18 Jun 2024 09:28:15 +0100 Subject: [PATCH] dont generate routes for now - dist is too big for azure swa --- nuxt.config.js | 65 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/nuxt.config.js b/nuxt.config.js index cf17530..fe09637 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -154,38 +154,39 @@ export default { generate: { fallback: true, - routes () { - const { $content } = require('@nuxt/content'); - const aliceTitles = $content('data', { deep: true }) - .where({ slug: { $contains: 'combined-alice-in-wonderland-titles' } }) - .fetch(); - const aliceParagraphs = $content('data', { deep: true }) - .where({ slug: { $contains: 'combined-alice-in-wonderland-paragraphs' } }) - .fetch(); - const mobyTitles = $content('data', { deep: true }) - .where({ slug: { $contains: 'moby-dick-or-the-whale-titles' } }) - .fetch(); - const mobyParagraphs = $content('data', { deep: true }) - .where({ slug: { $contains: 'moby-dick-or-the-whale-paragraphs' } }) - .fetch(); - - return Promise.all([aliceTitles, aliceParagraphs, mobyTitles, mobyParagraphs]).then( - ([aliceTitlesData, aliceParagraphsData, mobyTitlesData, mobyParagraphsData]) => { - // Map each item to a route - const aliceTitleRoutes = aliceTitlesData.map(title => `/titles/alice/${title.id}`); - const aliceParagraphRoutes = aliceParagraphsData.map(para => `/paragraphs/alice/${para.id}`); - const mobyTitleRoutes = mobyTitlesData.map(title => `/titles/moby-dick/${title.id}`); - const mobyParagraphRoutes = mobyParagraphsData.map(para => `/paragraphs/moby-dick/${para.id}`); - - return [ - ...aliceTitleRoutes, - ...aliceParagraphRoutes, - ...mobyTitleRoutes, - ...mobyParagraphRoutes - ]; - } - ); - }, + // ssr: false, + // routes () { + // const { $content } = require('@nuxt/content'); + // const aliceTitles = $content('data', { deep: true }) + // .where({ slug: { $contains: 'combined-alice-in-wonderland-titles' } }) + // .fetch(); + // const aliceParagraphs = $content('data', { deep: true }) + // .where({ slug: { $contains: 'combined-alice-in-wonderland-paragraphs' } }) + // .fetch(); + // const mobyTitles = $content('data', { deep: true }) + // .where({ slug: { $contains: 'moby-dick-or-the-whale-titles' } }) + // .fetch(); + // const mobyParagraphs = $content('data', { deep: true }) + // .where({ slug: { $contains: 'moby-dick-or-the-whale-paragraphs' } }) + // .fetch(); + // + // return Promise.all([aliceTitles, aliceParagraphs, mobyTitles, mobyParagraphs]).then( + // ([aliceTitlesData, aliceParagraphsData, mobyTitlesData, mobyParagraphsData]) => { + // // Map each item to a route + // const aliceTitleRoutes = aliceTitlesData.map(title => `/titles/alice/${title.id}`); + // const aliceParagraphRoutes = aliceParagraphsData.map(para => `/paragraphs/alice/${para.id}`); + // const mobyTitleRoutes = mobyTitlesData.map(title => `/titles/moby-dick/${title.id}`); + // const mobyParagraphRoutes = mobyParagraphsData.map(para => `/paragraphs/moby-dick/${para.id}`); + // + // return [ + // ...aliceTitleRoutes, + // ...aliceParagraphRoutes, + // ...mobyTitleRoutes, + // ...mobyParagraphRoutes + // ]; + // } + // ); + // }, }, sitemap: {