From 0ec21ba56add95d3cf856a7ae6aaf9e33c9faa93 Mon Sep 17 00:00:00 2001 From: Danny Gleckler Date: Wed, 26 Jul 2023 11:21:38 -0400 Subject: [PATCH] fix: Windows headed mode (#97) --- 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}`; } }