Skip to main content

run_build_pipeline

Function run_build_pipeline 

Source
pub async fn run_build_pipeline(
    args: &ModeArgs,
    reload_tx: Option<&Sender<ReloadEvent>>,
) -> Result<String, EuvError>
Expand description

Executes a full build pipeline: euv fmt, build wasm, generate HTML, then remove the JavaScript that was inlined into it.

Only a pipeline whose wasm build, page write and JavaScript cleanup all succeeded broadcasts a reload. A failure at any phase notifies the client of the error and leaves the previous page in memory, so a browser is never pointed at a page whose inlined bootstrap references a deleted file.

§Arguments

  • &ModeArgs - The CLI arguments.
  • Option<&broadcast::Sender<ReloadEvent>> - Optional reload channel for notifying clients.

§Returns

  • Result<String, EuvError> - The generated HTML with reload script injected on success.