Skip to content

resources.ts#

View Markdown

Source

4 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

4 symbols 3 functions 1 modules 6 parameters 3 returns

Reference#

fnisInsideRoot(root: string, candidate: string): booleanTrue when candidate stays inside root after resolve.

True when candidate stays inside root after resolve.

Signature

export function isInsideRoot(root: string, candidate: string): boolean

View source

Parameters

  • root string
  • candidate string

Returns

boolean
fnresolveResourcesOptions(value: boolean | ResourcesOptions | undefined): ResolvedResourcesOptionsResolves resources. Omitted / false stay off. true or {} enables defaults. An o…

Resolves resources. Omitted / false stay off. true or {} enables defaults. An object enables the feature and overrides only set fields.

Signature

export function resolveResourcesOptions(value: boolean | ResourcesOptions | undefined): ResolvedResourcesOptions

View source

Parameters

Returns

ResolvedResourcesOptions
fnresourceCacheKey(sourcePath: string, mtimeMs: number, transform: ResourceTransform): stringCache key for a source file plus transform. Changing mtime or params produces a…

Cache key for a source file plus transform. Changing mtime or params produces a different key so stale derivatives are not reused.

Signature

export function resourceCacheKey(sourcePath: string, mtimeMs: number, transform: ResourceTransform): string

View source

Parameters

  • sourcePath string
  • mtimeMs number
  • transform ResourceTransform

Returns

string
moduleresourcesOpt-in page-bundle resources and build-time image processing. A page directory is the bundle root. Sibling images are a…

Opt-in page-bundle resources and build-time image processing.

A page directory is the bundle root. Sibling images are addressable with relative URLs. Resize/crop/format query transforms run at build time and are cached by source mtime plus transform params. Paths that leave the bundle or srcDir are never processed.

View source