Skip to content

Commit a34370c

Browse files
Hydrophobefiremandummdidummignatiusmb
authored
[adapter-vercel] Use path/posix to resolve the relative path (issue#3163) (#3200)
* Use path/posix to resolve the relative path if we use the default path implementation, on windows we get malformed output since esmodules use "/" as the seperator (related #3163 ) * use posix as export instead of subpackage * Add changeset * Update .changeset/fuzzy-jobs-retire.md Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com>
1 parent 2839689 commit a34370c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/fuzzy-jobs-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-vercel': patch
3+
---
4+
5+
Use path.posix to resolve routes for esmodules

packages/adapter-vercel/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { writeFileSync } from 'fs';
2-
import { relative } from 'path';
2+
import { posix } from 'path';
33
import { fileURLToPath } from 'url';
44
import esbuild from 'esbuild';
55

@@ -31,7 +31,7 @@ export default function () {
3131

3232
builder.log.minor('Generating serverless function...');
3333

34-
const relativePath = relative(tmp, builder.getServerDirectory());
34+
const relativePath = posix.relative(tmp, builder.getServerDirectory());
3535

3636
builder.copy(files, tmp, {
3737
replace: {

0 commit comments

Comments
 (0)