Options for configuring the StaticPlugin.
root: string
Required. The filesystem directory to serve files from.
fs: IFileSystem
The filesystem to use for file operations.
urlPrefix: string
URL prefix for static routes (default: '/').
index: string
Index file to serve when a directory is requested (default: 'index.html'). Set to empty string '' to disable index resolution.
fallback: string
Fallback file to serve for missing paths when Accept includes text/html (default: undefined). Used for SPA fallback.
cacheControl: string | ((relativePath: string) => string)
Cache-Control header configuration (default: function returning immutable for hashed assets, must-revalidate for others).
- A string is used verbatim for all responses.
- A function is called per request with the root-relative path.
etag: boolean
Enable ETag generation (default: true).
ranges: boolean
Enable Range request handling (default: true).
compressed: boolean
Enable precompressed sidecar negotiation (default: true).
maxBufferBytes: number
Maximum file size to read fully into memory (default: 1MB). Files larger than this will use streaming when available.