nodeArgs
uses node:path
Node flags for processes tcm spawns; the transform hook, when the cache has one, compiles marked modules.
import { pathToFileURLString } from "#codebase/tcmts/loader"; import type { Layout } from "#codebase/tcmts/loader"; import fs from "node:fs"; import path from "node:path"; export function nodeArgs(lay: Layout): string[] { const hook = path.join(lay.cacheDir, "tcm-transform.js"); // source maps: stack traces point at definitions (.tcm/src) and scratch files, not generated modules return ["--disable-warning=ExperimentalWarning", "--enable-source-maps", ...(fs.existsSync(hook) ? ["--import", pathToFileURLString(hook)] : [])]; }