Within my nuxt.config.ts file, I have the ability to generate multiple routes using the following code:
export default defineNuxtConfig({
generate: {
routes: ['/products/1', '/products/2']
},
})
After running nuxt generate
, this will create a product folder inside my dist directory with subfolders for each product (product 1 and product 2) containing the HTML files.
However, these product routes are accessed via a GET request to an API endpoint, so I need to generate them directly within my pages. In Nuxt 2, we accomplished this by referring to .
generate: {
routes: ['/products/1', '/products/2']
}
When attempting this in Nuxt3, my product pages are not being generated. I am uncertain if the 'generated' property is still available and how to achieve the desired outcome. Can you provide any insight on this?