feat(utilityservers): add injectReload and noCache options and enable dev features by default
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user