Skip to content

Commit 01e2bfb

Browse files
ha1fstackvicb
andauthored
fix: manifest glob on windows (#413)
Co-authored-by: Victor Berchet <[email protected]>
1 parent 6d3291f commit 01e2bfb

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.changeset/warm-dragons-search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/cloudflare": patch
3+
---
4+
5+
improve windows support

packages/cloudflare/src/cli/build/patches/ast/patch-vercel-og-library.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export function patchVercelOgLibrary(buildOpts: BuildOptions) {
2121
const functionsPath = path.join(outputDir, "server-functions/default");
2222
const packagePath = path.join(functionsPath, getPackagePath(buildOpts));
2323

24-
for (const traceInfoPath of globSync(path.join(appBuildOutputPath, ".next/server/**/*.nft.json"))) {
24+
for (const traceInfoPath of globSync(path.join(appBuildOutputPath, ".next/server/**/*.nft.json"), {
25+
windowsPathsNoEscape: true,
26+
})) {
2527
const traceInfo: TraceInfo = JSON.parse(readFileSync(traceInfoPath, { encoding: "utf8" }));
2628
const tracedNodePath = traceInfo.files.find((p) => p.endsWith("@vercel/og/index.node.js"));
2729

packages/cloudflare/src/cli/build/patches/plugins/eval-manifest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ async function getRule(buildOpts: BuildOptions) {
2929

3030
const baseDir = join(outputDir, "server-functions/default", getPackagePath(buildOpts), ".next");
3131
const appDir = join(baseDir, "server/app");
32-
const manifests = await glob(join(baseDir, "**/*_client-reference-manifest.js"));
32+
const manifests = await glob(join(baseDir, "**/*_client-reference-manifest.js"), {
33+
windowsPathsNoEscape: true,
34+
});
3335

3436
const returnManifests = manifests
3537
.map((manifest) => {

packages/cloudflare/src/cli/build/patches/plugins/load-manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function getRule(buildOpts: BuildOptions) {
3030
const baseDir = join(outputDir, "server-functions/default", getPackagePath(buildOpts));
3131
const dotNextDir = join(baseDir, ".next");
3232

33-
const manifests = await glob(join(dotNextDir, "**/*-manifest.json"));
33+
const manifests = await glob(join(dotNextDir, "**/*-manifest.json"), { windowsPathsNoEscape: true });
3434

3535
const returnManifests = (
3636
await Promise.all(

0 commit comments

Comments
 (0)