isServerHostFile

tcmts.core.analyze.isServerHostFile · #2bme3bp5 · term · runs on the server

uses node:path

The generated runtime of #tcm/host, as cache modules and re-analyzed definitions import it.

import type { AnalyzeHost } from "#codebase/tcmts/core/analyze";
import path_1 from "node:path";

export function isServerHostFile(spec: string, file: string, host: AnalyzeHost): boolean {
  return (
    /^\.\.?\//.test(spec) &&
    path_1.resolve(path_1.dirname(file), spec) === path_1.join(host.cacheDir, "tcm-host.js")
  );
}

uses

used by