copyWith method
BuildConfig
copyWith({
- String? rootDir,
- String? host,
- int? port,
- BuildTarget? target,
- String? routesDir,
- String? middlewareDir,
- String? publicDir,
- String? outputDir,
- ReloadStrategy? reload,
- Object? wranglerConfig = _unset,
Returns a copy with selected fields replaced.
Implementation
BuildConfig copyWith({
String? rootDir,
String? host,
int? port,
BuildTarget? target,
String? routesDir,
String? middlewareDir,
String? publicDir,
String? outputDir,
ReloadStrategy? reload,
Object? wranglerConfig = _unset,
}) {
return BuildConfig(
rootDir: rootDir ?? this.rootDir,
host: host ?? this.host,
port: port ?? this.port,
target: target ?? this.target,
routesDir: routesDir ?? this.routesDir,
middlewareDir: middlewareDir ?? this.middlewareDir,
publicDir: publicDir ?? this.publicDir,
outputDir: outputDir ?? this.outputDir,
reload: reload ?? this.reload,
wranglerConfig: switch (wranglerConfig) {
_Unset() => this.wranglerConfig,
String() => wranglerConfig,
null => null,
_ => throw ArgumentError.value(
wranglerConfig,
'wranglerConfig',
'must be a string or null',
),
},
);
}