{ "id": "qwik-router-ssg", "package": "@qwik.dev/router/ssg", "members": [ { "name": "generate", "id": "generate", "hierarchy": [ { "name": "generate", "id": "generate" } ], "kind": "Function", "content": "Use this function when SSG should be generated from another module, such as a Vite plugin. This function's should be passed the paths of the entry module and Qwik Router Plan.\n\n\n```typescript\nexport declare function generate(opts: SsgGenerateOptions): Promise;\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\n[SsgGenerateOptions](#ssginternaloptions)\n\n\n\n\n\n
\n\n**Returns:**\n\nPromise<[SsgResult](#staticgenerateresult)>", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/index.ts", "mdFile": "router.generate.md" }, { "name": "runSsg", "id": "runssg", "hierarchy": [ { "name": "runSsg", "id": "runssg" } ], "kind": "Function", "content": "Run SSG as a standalone process. Writes `_static-paths.json` to `outDir` and exits with code 0 on success, 1 on error.\n\nIntended to be called from a generated `run-ssg.js` wrapper that provides render/config.\n\n\n```typescript\nexport declare function runSsg(opts: SsgGenerateOptions): Promise;\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\n[SsgGenerateOptions](#ssginternaloptions)\n\n\n\n\n\n
\n\n**Returns:**\n\nPromise<never>", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/index.ts", "mdFile": "router.runssg.md" }, { "name": "SsgInternalOptions", "id": "ssginternaloptions", "hierarchy": [ { "name": "SsgInternalOptions", "id": "ssginternaloptions" } ], "kind": "Interface", "content": "Internal SSG options that include the render function and router config.\n\n\n```typescript\nexport interface SsgGenerateOptions extends SsgOptions \n```\n**Extends:** [SsgOptions](#ssgoptions)\n\n\n\n\n\n\n
\n\nProperty\n\n\n\n\nModifiers\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nqwikRouterConfig\n\n\n\n\n\n\n\nQwikRouterConfig\n\n\n\n\nThe Qwik Router Config object (default export from `@qwik-router-config`).\n\n\n
\n\nrender\n\n\n\n\n\n\n\nRender\n\n\n\n\nSSR render function (default export from `entry.ssr`); worker-only — the main entry omits it.\n\n\n
\n\nworkerFilePath?\n\n\n\n\n\n\n\nstring \\| URL\n\n\n\n\n_(Optional)_ Path or URL to the worker entry file (`run-ssg-worker.js`); workers are spawned from it.\n\n\n
", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/types.ts", "mdFile": "router.ssginternaloptions.md" }, { "name": "SsgOptions", "id": "ssgoptions", "hierarchy": [ { "name": "SsgOptions", "id": "ssgoptions" } ], "kind": "Interface", "content": "```typescript\nexport interface SsgOptions extends SsgRenderOptions \n```\n**Extends:** [SsgRenderOptions](#ssgrenderoptions)\n\n\n\n\n\n
\n\nProperty\n\n\n\n\nModifiers\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nbasePathname?\n\n\n\n\n\n\n\nstring\n\n\n\n\n_(Optional)_ Defaults to `/`\n\n\n
\n\nrootDir?\n\n\n\n\n\n\n\nstring\n\n\n\n\n_(Optional)_\n\n\n
", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/types.ts", "mdFile": "router.ssgoptions.md" }, { "name": "SsgRenderOptions", "id": "ssgrenderoptions", "hierarchy": [ { "name": "SsgRenderOptions", "id": "ssgrenderoptions" } ], "kind": "Interface", "content": "```typescript\nexport interface SsgRenderOptions extends RenderOptions \n```\n**Extends:** RenderOptions\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\nProperty\n\n\n\n\nModifiers\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nemitData?\n\n\n\n\n\n\n\nboolean\n\n\n\n\n_(Optional)_ Set to `false` if the generated per-loader data files should not be written to disk. Defaults to `true`.\n\n\n
\n\nemitHtml?\n\n\n\n\n\n\n\nboolean\n\n\n\n\n_(Optional)_ Set to `false` if the generated static HTML files should not be written to disk. Setting to `false` is useful if the SSG should only write the per-loader data files to disk. Defaults to `true`.\n\n\n
\n\nexclude?\n\n\n\n\n\n\n\nstring\\[\\]\n\n\n\n\n_(Optional)_ Defines file system routes relative to the source `routes` directory that should not be static generated. Accepts wildcard behavior. This should not include the \"base\" pathname. `exclude` always takes priority over `include`.\n\n\n
\n\ninclude?\n\n\n\n\n\n\n\nstring\\[\\]\n\n\n\n\n_(Optional)_ Defines file system routes relative to the source `routes` directory that should be static generated. Accepts wildcard behavior. This should not include the \"base\" pathname. If not provided, all routes will be static generated. `exclude` always takes priority over `include`.\n\n\n
\n\nlog?\n\n\n\n\n\n\n\n'debug' \\| 'quiet'\n\n\n\n\n_(Optional)_ Log level. `'quiet'` suppresses per-page output, `'debug'` enables verbose logging.\n\n\n
\n\nmaxTasksPerWorker?\n\n\n\n\n\n\n\nnumber\n\n\n\n\n_(Optional)_ Maximum number of tasks to be running at one time per worker. Defaults to `20`.\n\n\n
\n\nmaxWorkers?\n\n\n\n\n\n\n\nnumber\n\n\n\n\n_(Optional)_ Maximum number of workers to use while generating the static pages. Defaults to the number of CPUs available.\n\n\n
\n\norigin\n\n\n\n\n\n\n\nstring\n\n\n\n\nThe URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the `origin` does not include a `pathname`.\n\nThe `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate a complete URL rather than just the `pathname`. For example, in order to render a correct canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.\n\nIf the site also starts with a pathname other than `/`, please use the `basePathname` option in the Qwik Router config options.\n\n\n
\n\noutDir\n\n\n\n\n\n\n\nstring\n\n\n\n\nFile system directory where the static files should be written.\n\n\n
\n\nretries?\n\n\n\n\n\n\n\nnumber\n\n\n\n\n_(Optional)_ Number of times to retry a route whose render failed or timed out, or an `onStaticGenerate` call that threw, before recording the error. Each retry waits 500ms, doubling up to 2s, plus up to 30% at random. Defaults to `0` (the first failure is final).\n\n\n
\n\nsitemapOutFile?\n\n\n\n\n\n\n\nstring \\| null\n\n\n\n\n_(Optional)_ File system path to write the `sitemap.xml` to. Defaults to `sitemap.xml` and written to the root of the `outDir`. Setting to `null` will prevent the sitemap from being created.\n\n\n
", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/types.ts", "mdFile": "router.ssgrenderoptions.md" }, { "name": "startWorker", "id": "startworker", "hierarchy": [ { "name": "startWorker", "id": "startworker" } ], "kind": "Function", "content": "Bootstrap a worker thread for SSG rendering. Called from the generated `run-ssg.js` when it detects it's running as a worker thread.\n\n\n```typescript\nexport declare function startWorker(opts: Pick): Promise;\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\nPick<[SsgGenerateOptions](#ssginternaloptions), 'render' \\| 'qwikRouterConfig'>\n\n\n\n\nMust include `render` and `qwikRouterConfig` (imported by the worker entry). The remaining serializable options come from `workerData`.\n\n\n
\n\n**Returns:**\n\nPromise<void>", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/index.ts", "mdFile": "router.startworker.md" }, { "name": "StaticGenerateResult", "id": "staticgenerateresult", "hierarchy": [ { "name": "StaticGenerateResult", "id": "staticgenerateresult" } ], "kind": "Interface", "content": "```typescript\nexport interface SsgResult \n```\n\n\n\n\n\n\n\n\n
\n\nProperty\n\n\n\n\nModifiers\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nduration\n\n\n\n\n\n\n\nnumber\n\n\n\n\n\n
\n\nerrors\n\n\n\n\n\n\n\nnumber\n\n\n\n\n\n
\n\nrendered\n\n\n\n\n\n\n\nnumber\n\n\n\n\n\n
\n\nretried\n\n\n\n\n\n\n\nnumber\n\n\n\n\n\n
\n\nstaticPaths\n\n\n\n\n\n\n\nstring\\[\\]\n\n\n\n\n\n
", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/ssg/types.ts", "mdFile": "router.staticgenerateresult.md" } ] }