GoogleFontsOptions
Options that control the Google step of defineFonts.
Options that control the Google step of defineFonts.
Import#
ts
import type { GoogleFontsOptions } from "@shadow-js/dusk/vite";
Signature#
ts
interface GoogleFontsOptions {
/** The project root: `fonts.lock.json` and the cache sit here. Default: the parent of `publicDir`. */
readonly root?: string;
/** Never touch the network: use the cache and the vendored files, which must match the lock. Default false. */
readonly offline?: boolean;
/**
* Fail when the stylesheet differs from `fonts.lock.json` as well as when a file does (for CI). A file whose hash
* differs from the lock fails the build in every mode, and is never written.
*/
readonly frozen?: boolean;
/**
* Accept a file whose hash differs from `fonts.lock.json` and record the new hash. The URLs Google serves are
* versioned, so the bytes behind one should never change: use this only when you have reviewed the change. Not with `frozen`.
*/
readonly updateLock?: boolean;
/** The `fetch` for the API and the files. Default: the global one. */
readonly fetch?: (url: string, init?: RequestInit) => Promise<Response>;
}
Members#
| Name | Type | Description |
|---|---|---|
root? |
readonly root?: string |
The project root: fonts.lock.json and the cache sit here. Default: the parent of publicDir. |
offline? |
readonly offline?: boolean |
Never touch the network: use the cache and the vendored files, which must match the lock. Default false. |
frozen? |
readonly frozen?: boolean |
Fail when the stylesheet differs from fonts.lock.json as well as when a file does (for CI). A file whose hash differs from the lock fails the build in every mode, and is never written. |
updateLock? |
readonly updateLock?: boolean |
Accept a file whose hash differs from fonts.lock.json and record the new hash. The URLs Google serves are versioned, so the bytes behind one should never change: use this only when you have reviewed the change. Not with frozen. |
fetch? |
readonly fetch?: (url: string, init?: RequestInit) => Promise<Response> |
The fetch for the API and the files. Default: the global one. |