Skip to content

Commit

Permalink
file sysmte route cross platofmr
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Aug 7, 2023
1 parent 1d04f1c commit 7cc3443
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/vinxi/lib/file-system-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import esbuild from "esbuild";
import fg from "fast-glob";
import fs from "fs";
import micromatch from "micromatch";
import os from "os";
import { join } from "path";
import { pathToRegexp } from "path-to-regexp";

Expand Down Expand Up @@ -36,9 +37,13 @@ export class BaseFileSystemRouter {
}

glob() {
return (
join(this.config.dir, "**/*") + `.{${this.config.extensions.join(",")}}`
);
if (os.platform() === "win32") {
return fg.convertPathToPattern(this.config.dir + "//**//*");
} else {
return (
join(this.config.dir, "**/*") + `.{${this.config.extensions.join(",")}}`
);
}
}

/**
Expand Down

0 comments on commit 7cc3443

Please sign in to comment.