From 220c9c1d922306a124feb60d2078ed5183ca6b0e Mon Sep 17 00:00:00 2001 From: Matias Capeletto Date: Mon, 4 Jan 2021 08:03:41 +0100 Subject: [PATCH] fix: resolvePageImports for win32 (#193) --- src/node/build/render.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/build/render.ts b/src/node/build/render.ts index 8ec778bb..4c2d54c8 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -2,6 +2,7 @@ import path from 'path' import fs from 'fs-extra' import { SiteConfig, resolveSiteDataByRoute } from '../config' import { HeadConfig } from '../../../types/shared' +import { normalizePath } from 'vite' import { RollupOutput, OutputChunk, OutputAsset } from 'rollup' const escape = require('escape-html') @@ -88,7 +89,7 @@ function resolvePageImports( // find the page's js chunk and inject script tags for its imports so that // they are start fetching as early as possible - const srcPath = path.resolve(config.root, page) + const srcPath = normalizePath(path.resolve(config.root, page)) const pageChunk = result.output.find( (chunk) => chunk.type === 'chunk' && chunk.facadeModuleId === srcPath ) as OutputChunk