generated from egoist/ts-lib-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
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
alexandrutocar, kran6a and shiro
Metadata
Metadata
Assignees
Labels
No labels