From f4076fb1b1c3498725d8396465ceae430b011534 Mon Sep 17 00:00:00 2001 From: Danny Gleckler Date: Tue, 25 Jul 2023 12:53:16 -0400 Subject: [PATCH] Fix Windows headed mode --- src/server/headed-mode-plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/headed-mode-plugin.js b/src/server/headed-mode-plugin.js index 2a371d1d..c167494a 100644 --- a/src/server/headed-mode-plugin.js +++ b/src/server/headed-mode-plugin.js @@ -1,4 +1,4 @@ -import { dirname, join } from 'node:path'; +import { dirname, posix } from 'node:path'; import { globSync } from 'glob'; export function headedMode({ open, watch, pattern }) { @@ -9,7 +9,7 @@ export function headedMode({ open, watch, pattern }) { name: 'brightspace-headed-mode', async transform(context) { if ((watch || open) && files.includes(context.path.slice(1))) { - const pausePath = join(dirname(import.meta.url), 'pause.js').replace('file:', ''); + const pausePath = posix.join(dirname(import.meta.url), 'pause.js').replace(/file:(\/c:)?/i, ''); return `debugger;\nimport '${pausePath}'\n${context.body}`; } }