@@ -72,7 +72,7 @@ import {
7272} from "../../project/types.ts" ;
7373import { projectOutputDir } from "../../project/project-shared.ts" ;
7474import { projectContext } from "../../project/project-context.ts" ;
75- import { pathWithForwardSlashes } from "../../core/path.ts" ;
75+ import { normalizePath , pathWithForwardSlashes } from "../../core/path.ts" ;
7676import {
7777 isJupyterHubServer ,
7878 isRStudioServer ,
@@ -168,7 +168,7 @@ export async function preview(
168168 const handler = isPdfContent ( result . outputFile )
169169 ? pdfFileRequestHandler (
170170 result . outputFile ,
171- Deno . realPathSync ( file ) ,
171+ normalizePath ( file ) ,
172172 flags ,
173173 result . format ,
174174 options . port ! ,
@@ -178,15 +178,15 @@ export async function preview(
178178 : project
179179 ? projectHtmlFileRequestHandler (
180180 project ,
181- Deno . realPathSync ( file ) ,
181+ normalizePath ( file ) ,
182182 flags ,
183183 result . format ,
184184 reloader ,
185185 changeHandler . render ,
186186 )
187187 : htmlFileRequestHandler (
188188 result . outputFile ,
189- Deno . realPathSync ( file ) ,
189+ normalizePath ( file ) ,
190190 flags ,
191191 result . format ,
192192 reloader ,
@@ -368,7 +368,7 @@ async function renderForPreview(
368368 // determine files to watch for reload -- take the resource
369369 // files detected during render, chase down additional references
370370 // in css files, then fitler out the _files dir
371- file = Deno . realPathSync ( file ) ;
371+ file = normalizePath ( file ) ;
372372 const filesDir = join ( dirname ( file ) , inputFilesDir ( file ) ) ;
373373 const resourceFiles = renderResult . files . reduce (
374374 ( resourceFiles : string [ ] , file : RenderResultFile ) => {
@@ -399,7 +399,7 @@ async function renderForPreview(
399399 if ( ! isAbsolute ( extensionFile ) ) {
400400 const extensionFullPath = join ( dirname ( file . input ) , extensionFile ) ;
401401 if ( existsSync ( extensionFullPath ) ) {
402- extensionFiles . push ( Deno . realPathSync ( extensionFullPath ) ) ;
402+ extensionFiles . push ( normalizePath ( extensionFullPath ) ) ;
403403 }
404404 }
405405 } ) ;
@@ -522,7 +522,7 @@ function previewWatcher(watches: Watch[]): Watcher {
522522 return {
523523 ...watch ,
524524 files : watch . files . filter ( existsSync ) . map ( ( file ) => {
525- return Deno . realPathSync ( file ) ;
525+ return normalizePath ( file ) ;
526526 } ) ,
527527 } ;
528528 } ) ;
@@ -635,7 +635,7 @@ function htmlFileRequestHandlerOptions(
635635 if (
636636 prevReq &&
637637 existsSync ( prevReq . path ) &&
638- Deno . realPathSync ( prevReq . path ) === Deno . realPathSync ( inputFile ) &&
638+ normalizePath ( prevReq . path ) === normalizePath ( inputFile ) &&
639639 await previewRenderRequestIsCompatible ( prevReq , flags )
640640 ) {
641641 // don't wait for the promise so the
0 commit comments