diff --git a/.changeset/early-news-taste.md b/.changeset/early-news-taste.md new file mode 100644 index 000000000000..72aeb2178275 --- /dev/null +++ b/.changeset/early-news-taste.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-cloudflare': patch +--- + +use posix to resolve relative path diff --git a/packages/adapter-cloudflare/index.js b/packages/adapter-cloudflare/index.js index c1be491f5972..8f6061f4efe2 100644 --- a/packages/adapter-cloudflare/index.js +++ b/packages/adapter-cloudflare/index.js @@ -1,5 +1,5 @@ import { writeFileSync } from 'fs'; -import { relative } from 'path'; +import { posix } from 'path'; import { fileURLToPath } from 'url'; import * as esbuild from 'esbuild'; @@ -21,7 +21,7 @@ export default function (options = {}) { const { paths } = await builder.prerender({ dest }); - const relativePath = relative(tmp, builder.getServerDirectory()); + const relativePath = posix.relative(tmp, builder.getServerDirectory()); writeFileSync( `${tmp}/manifest.js`,