diff --git a/package.json b/package.json index 8102c7bd3464..ecd0d0a07b0f 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.2", + "vite": "^2.0.0-beta.4", "vue": "^3.0.5" }, "devDependencies": { diff --git a/src/node/build/render.ts b/src/node/build/render.ts index 8ec778bbb2fe..4c2d54c84737 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 diff --git a/yarn.lock b/yarn.lock index 3723d48038d2..f666a8e5934c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.2: - version "2.0.0-beta.2" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.2.tgz#5ea8fd4a01d0f722db59bff2bdc4ae24ba9fa63a" - integrity sha512-bZ2IeW+Uo4A7HpRIqyyHUDk6/WOGIkNdTm5/0yLmgjvXgLErwUhzv7Z0T0C6lc4lwoQV9KEA8IbFkZ+ZyWzhWg== +vite@^2.0.0-beta.4: + version "2.0.0-beta.4" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.4.tgz#6ea8e08ae5e6b510548d02ec770d34046622aef7" + integrity sha512-V0HV6xyUPQ9ktJ8gLm0Et7zTFtp8WmISsH/K+FuGF3aJ4VJOlSYEaget1nHCauUPI7WDPe97suz7SCIVHW2iEg== dependencies: esbuild "^0.8.26" postcss "^8.2.1"