public function compile(File $template, array $template_vars = []): string {
    $template = $template->makeLocal();

    if(!empty($this->preprocessors)) {
      $processed_code = $template->readAll();

      foreach($this->preprocessors as $preprocessor) {
        $processed_code = $preprocessor->transform($processed_code);
      }

      $template = $this->cache->child[$template->name];

      if(!($template instanceof LocalFile)) {
        throw new RuntimeException('Template cache is not a file');
      }

      $template->writeAll($processed_code);
    }

    $output = $this->compiler->compile($template, $template_vars);

    foreach($this->postprocessors as $postprocessor) {
      $output = $postprocessor->transform($output);
    }

    return $output;
  }