From a3a0f005face9ad6379bc40ac1d70d68236a90fe Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 9 Jan 2023 09:52:56 +0000 Subject: [PATCH] docs: remove nuxt 2 information from `generate` schema (#10002) --- packages/schema/src/config/generate.ts | 47 ++------------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/packages/schema/src/config/generate.ts b/packages/schema/src/config/generate.ts index 0a6f7f0c44..7a01192821 100644 --- a/packages/schema/src/config/generate.ts +++ b/packages/schema/src/config/generate.ts @@ -8,60 +8,17 @@ export default defineUntypedSchema({ * If you are using the crawler, this will be only the starting point for route generation. * This is often necessary when using dynamic routes. * - * It can be an array or a function. + * It is preferred to use `nitro.prerender.routes`. * * @example * ```js * routes: ['/users/1', '/users/2', '/users/3'] * ``` - * - * You can pass a function that returns a promise or a function that takes a callback. It should - * return an array of strings or objects with `route` and (optional) `payload` keys. - * - * @example - * ```js - * export default { - * generate: { - * async routes() { - * const res = await axios.get('https://my-api/users') - * return res.data.map(user => ({ route: '/users/' + user.id, payload: user })) - * } - * } - * } - * ``` - * Or instead: - * ```js - * export default { - * generate: { - * routes(callback) { - * axios - * .get('https://my-api/users') - * .then(res => { - * const routes = res.data.map(user => '/users/' + user.id) - * callback(null, routes) - * }) - * .catch(callback) - * } - * } - * } - * ``` - * - * If `routes()` returns a payload, it can be accessed from the Nuxt context. - * @example - * ```js - * export default { - * async useAsyncData ({ params, error, payload }) { - * if (payload) return { user: payload } - * else return { user: await backend.fetchUser(params.id) } - * } - * } - * ``` */ routes: [], /** - * An array of string or regular expressions that will prevent generation - * of routes matching them. The routes will still be accessible when `fallback` is set. + * This option is no longer used. Instead, use `nitro.prerender.ignore`. */ exclude: [] }