Skip to content

Commit

Permalink
fix: really truly fix windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
lino-levan committed Aug 12, 2023
1 parent c1b30c7 commit ef35746
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/lib/render.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { fromFileUrl, resolve } from "std/path/mod.ts";
import { fromFileUrl, join, resolve, toFileUrl } from "std/path/mod.ts";
import { extract } from "std/front_matter/any.ts";
import { existsSync } from "std/fs/exists.ts";
import { join } from "std/path/join.ts";
import { renderToString } from "preact-render-to-string";
import * as esbuild from "esbuild";
import { denoPlugins } from "esbuild_deno_loader";
Expand Down Expand Up @@ -48,17 +47,15 @@ export async function render(

let configPath = import.meta.resolve("../../deno.jsonc");

try {
configPath = fromFileUrl(import.meta.resolve("../../deno.jsonc"));
} catch {
// no-op
if (configPath.startsWith("file:")) {
configPath = fromFileUrl(configPath);
}

const result = await esbuild.build({
plugins: [...denoPlugins({
configPath,
})],
entryPoints: [entrypoint],
entryPoints: [toFileUrl(entrypoint).href],
bundle: true,
write: false,
format: "esm",
Expand Down

0 comments on commit ef35746

Please sign in to comment.