From cb79b701c707200f53539af6b343ee17721ab27d Mon Sep 17 00:00:00 2001 From: James Goldie Date: Tue, 11 Jul 2023 16:03:52 +1000 Subject: [PATCH] Add Deno Windows fix to /docs --- docs/_extensions/sverto/compile-imports.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/_extensions/sverto/compile-imports.ts b/docs/_extensions/sverto/compile-imports.ts index fd89a6e..312b8fb 100644 --- a/docs/_extensions/sverto/compile-imports.ts +++ b/docs/_extensions/sverto/compile-imports.ts @@ -5,9 +5,11 @@ import * as path from "https://deno.land/std/path/mod.ts"; const thisScript = path.fromFileUrl(import.meta.url); const rollupConfig = path.join(path.dirname(thisScript), "rollup.config.js"); +// run svelte compiler via rollup +// (prepend cmd /c to the command on windows) +const cmdPrefix = Deno.build.os == "windows" ? ["cmd", "/c"] : [] +const cmd = cmdPrefix.concat(["npm", "run", "build", rollupConfig]); + // call rollup with the config file -const cmd = ["npm", "run", "build", rollupConfig]; const compileStep = Deno.run({ cmd }); await compileStep.status(); - -// console.log("Svelte compilation + bundling done!");