feat: pass resolved config to plugin.buildStart() (#1961)

This commit is contained in:
Marvin Hagemeister
2023-10-19 17:25:16 +02:00
committed by GitHub
parent c41cfc9227
commit cbd5b842b0
7 changed files with 85 additions and 61 deletions
+8 -4
View File
@@ -108,12 +108,16 @@ export interface FreshConfig {
onListen?: (params: { hostname: string; port: number }) => void;
}
export interface InternalFreshConfig {
dev: boolean;
export interface InternalFreshState {
config: ResolvedFreshConfig;
manifest: Manifest;
loadSnapshot: boolean;
denoJsonPath: string;
denoJson: DenoConfig;
manifest: Manifest;
}
export interface ResolvedFreshConfig {
dev: boolean;
build: {
outDir: string;
target: string | string[];
@@ -545,7 +549,7 @@ export interface Plugin<State = Record<string, unknown>> {
/**
* Called before running the Fresh build task
*/
buildStart?(): Promise<void> | void;
buildStart?(config: ResolvedFreshConfig): Promise<void> | void;
/**
* Called after completing the Fresh build task
*/