The peak chart is only for the contractor’s email, so you’ll load it only on the runs that ask for it. In Python, the digest’s chart import sits inside the chart option’s condition.
A separate check file prints Digest starting, then tests the chart option. Without the option,
Python’s version prints that line. The JavaScript port carries the same import
declaration into the matching block:
const args = process.argv.slice(2);
console.log("Digest starting");
if (args.includes("--chart")) {
import { peakChart } from "#boiler/chart.js";
console.log(peakChart([]));
}
Run it without the chart option, so the condition is false. JavaScript doesn’t print Digest
starting: the file is rejected before that message can print. The ten stack frames are cut here:
import { peakChart } from "#boiler/chart.js";
^
SyntaxError: Unexpected token '{'
...