Compile and dispatch authoritative acceptance hooks with target-specific package roots
This commit is contained in:
@@ -43,6 +43,8 @@ const coreURL = coreFile ? compiler.contentArtifactUrl(coreFile) : null;
|
||||
const coreServer = path.join(config.sharedRuntime, "core.mjs");
|
||||
await fs.mkdir(path.join(output, "share/quixos/generated"), { recursive: true });
|
||||
const portable = config.portable;
|
||||
for (const target of Object.keys(portable?.entries ?? {}))
|
||||
if (!["browser", "server"].includes(target)) throw Error(`Unsupported portable entry target ${target}`);
|
||||
for (const settings of [portable, config.remote].filter(Boolean))
|
||||
if (!/^[$A-Z_a-z][$\w]*$/.test(settings.registryExport))
|
||||
throw Error("Registry export must be a JavaScript identifier");
|
||||
@@ -82,7 +84,7 @@ for (const { target, mode, settings } of builds) {
|
||||
await fs.writeFile(path.join(work, bindingPath), source);
|
||||
generated.set(mode, { file: path.join(work, bindingPath), source });
|
||||
await fs.writeFile(path.join(output, "share/quixos/generated", `${mode}.ts`), source);
|
||||
const entry = relative(settings.entry);
|
||||
const entry = relative(settings.entries?.[target] ?? settings.entry);
|
||||
execFileSync(
|
||||
config.node,
|
||||
[
|
||||
|
||||
@@ -33,6 +33,7 @@ let
|
||||
else
|
||||
{
|
||||
inherit (portable) entry;
|
||||
entries = portable.entries or { };
|
||||
registryExport = portable.registryExport or "registry";
|
||||
bindingOutput = portable.bindingOutput or "src/gen/qx.ts";
|
||||
targets =
|
||||
|
||||
Reference in New Issue
Block a user