Skip to content

Commit 5821e61

Browse files
committed
bring back compile
1 parent f5d1d53 commit 5821e61

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

package/src/util/deno.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,31 @@ export async function compile(
4646
flags: string[],
4747
configuration: Configuration,
4848
) {
49-
throw new Error("Not implemented");
50-
}
49+
const denoBundleCmd: string[] = [];
50+
const denoExecPath = Deno.env.get("QUARTO_DENO");
51+
if (!denoExecPath) {
52+
throw Error("QUARTO_DENO is not defined");
53+
}
54+
denoBundleCmd.push("compile");
55+
denoBundleCmd.push("--unstable-kv");
56+
denoBundleCmd.push("--unstable-ffi");
57+
denoBundleCmd.push(
58+
"--importmap=" + configuration.importmap,
59+
);
60+
denoBundleCmd.push("--output");
61+
denoBundleCmd.push(output);
62+
denoBundleCmd.push(...flags);
5163

64+
denoBundleCmd.push(input);
65+
66+
const status = await execProcess({
67+
cmd: denoExecPath,
68+
args: denoBundleCmd,
69+
});
70+
if (status.code !== 0) {
71+
throw Error(`Failure to compile ${input}`);
72+
}
73+
}
5274
export async function install(
5375
input: string,
5476
flags: string[],

0 commit comments

Comments
 (0)