From 0480e9a6502695fb741fc300db03ef734f38b51c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 9 Jan 2023 21:42:25 -0400 Subject: attempt to fix path issues on windows --- src/write/build-modes/live-dev-server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js index f322a79b..a8e54247 100644 --- a/src/write/build-modes/live-dev-server.js +++ b/src/write/build-modes/live-dev-server.js @@ -151,7 +151,7 @@ export async function go({ if (localFileArea) { // Not security tested, man, this is a dev server!! - const safePath = path.resolve('/', localFilePath).replace(/^\//, ''); + const safePath = path.posix.resolve('/', localFilePath).replace(/^\//, ''); let localDirectory; if (localFileArea === 'static' || localFileArea === 'util') { @@ -160,7 +160,7 @@ export async function go({ localDirectory = mediaPath; } - const filePath = path.resolve(localDirectory, safePath); + const filePath = path.resolve(localDirectory, safePath.split('/').join(path.sep)); try { await stat(filePath); -- cgit 1.3.0-6-gf8a5