Skip to content

Commit

Permalink
fix: use path/posix to resolve relative paths (#3212)
Browse files Browse the repository at this point in the history
* fix: use path/posix to resolve relative paths

* Update .changeset/many-papayas-invite.md

* fix: use posix.relative instead of path/posix

#3212 (comment)

Co-authored-by: Ignatius Bagus <[email protected]>
  • Loading branch information
hyunbinseo and ignatiusmb authored Jan 5, 2022
1 parent 3cbfd9f commit a4402c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-papayas-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-cloudflare-workers': patch
---

use path/posix to resolve relative paths for esmodules
4 changes: 2 additions & 2 deletions packages/adapter-cloudflare-workers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync, writeFileSync } from 'fs';
import { relative } from 'path';
import { posix } from 'path';
import { execSync } from 'child_process';
import esbuild from 'esbuild';
import toml from '@iarna/toml';
Expand Down Expand Up @@ -35,7 +35,7 @@ export default function () {
builder.log.info(stdout.toString());

builder.log.minor('Generating worker...');
const relativePath = relative(tmp, builder.getServerDirectory());
const relativePath = posix.relative(tmp, builder.getServerDirectory());

builder.copy(`${files}/entry.js`, `${tmp}/entry.js`, {
replace: {
Expand Down

0 comments on commit a4402c4

Please sign in to comment.