feat(utilityservers): add injectReload and noCache options and enable dev features by default

This commit is contained in:
2026-02-24 22:26:45 +00:00
parent 14c8d83ab5
commit aa748e0d82
3 changed files with 15 additions and 4 deletions

View File

@@ -29,6 +29,10 @@ export interface IUtilityWebsiteServerConstructorOptions {
adsTxt?: string[];
/** Response compression configuration (default: enabled with brotli + gzip) */
compression?: plugins.smartserve.ICompressionConfig | boolean;
/** Disable browser caching (default: true when serveDir is set) */
noCache?: boolean;
/** Inject live-reload devtools script into HTML (default: true when serveDir is set) */
injectReload?: boolean;
}
/**
@@ -61,10 +65,10 @@ export class UtilityWebsiteServer {
domain: this.options.domain,
port,
// Development features (only when serving from filesystem)
injectReload: !!this.options.serveDir,
// Development features
injectReload: this.options.injectReload ?? true,
watch: !!this.options.serveDir,
noCache: !!this.options.serveDir,
noCache: this.options.noCache ?? true,
// SPA support (enabled by default for modern web apps)
spaFallback: this.options.spaFallback ?? true,