Skip to main content
Go to Latest
class FrugalInstance
import { FrugalInstance } from "https://deno.land/x/frugal@0.2.1/docs/dep/frugal/core.ts";

A Frugal instance.

Constructors

new
FrugalInstance(
config: CleanConfig,
moduleList: ModuleList,
loaderContext: LoaderContext,
)

Properties

readonly
config
readonly
routes

Methods

Build all the registered static pages.

A page might be skipped if nothing has changed since the last build or refresh of the page

clean(unnamed 0?: { justCache?: boolean; })

Wipe the outputDir.

if justCache is set to true, the outputDir is left untouched, and only the cache directory is wiped

generate(request: GenerationRequest<unknown>)

Generate the page (static or dynamic) matching the given pathname if it exists.

If a page match, the generation will always run, even if nothing has changed since the las build, refresh or generate.

refresh(pathname: string)

Refresh the static page matching the given pathname if it exists.

Event if the page match, it might be skipped if nothing has changed since the last build or refresh of the page

save(options?: { runtime?: boolean; })

Save the current Frugal instance, so it can be loaded with the Frugal.load method