currently this throws on runtime
// index.js
import.meta.compileTime("./codegen.js", "someName");
// TypeError: (intermediate value).compileTime is not a function
expected: "someName"
should be passed to the codegen function
// codegen.js
export default async ({ root, args }) => { // currently only "root" is passed
const name = args[0];
return {
code: `const ${name} = 42;`,
}
}
use case: generate code like
// static code
/** @type {Record<string, () => any>} */
const someFiles = {};
// generated code
someFiles["./a.js"] = () => import("./a.js");
someFiles["./b.js"] = () => import("./b.js");
... to allow some type-checking of the generated code
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too