Skip to content

Commit

Permalink
fix: malformed exclude rules when prerender: true. Fixes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
magne4000 committed Sep 19, 2024
1 parent a69eec6 commit 44d1e00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vike-cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cp, mkdir, rm, symlink, writeFile } from "node:fs/promises";
import { builtinModules } from "node:module";
import { dirname, isAbsolute, join, posix } from "node:path";
import { prerender } from "vike/prerender";
import { normalizePath, type Plugin, type ResolvedConfig } from "vite";
import { type Plugin, type ResolvedConfig, normalizePath } from "vite";
import hattipAsset from "../assets/hattip.js?raw";
import honoAsset from "../assets/hono.js?raw";
import vikeAsset from "../assets/vike.js?raw";
Expand Down Expand Up @@ -142,7 +142,9 @@ export const pages = (options?: VikeCloudflarePagesOptions): Plugin[] => {
await symlinkOrCopy(join(outClient, relPath), join(outCloudflare, relPath));
}

staticRoutes = relPaths.map((m) => (m.endsWith(".html") ? m.slice(0, -5) : m));
staticRoutes = relPaths
.map((m) => `/${m.endsWith(".html") ? m.slice(0, -5) : m}`)
.map((m) => (m.endsWith("/index") ? m.slice(0, -5) : m));
}

// 5. Create _routes.json
Expand Down

0 comments on commit 44d1e00

Please sign in to comment.