diff --git a/packages/vite/src/node/ssr/ssrManifestPlugin.ts b/packages/vite/src/node/ssr/ssrManifestPlugin.ts index 993fae1632ed5d..8bb9a8bcff75dc 100644 --- a/packages/vite/src/node/ssr/ssrManifestPlugin.ts +++ b/packages/vite/src/node/ssr/ssrManifestPlugin.ts @@ -59,7 +59,7 @@ export function ssrManifestPlugin(config: ResolvedConfig): Plugin { const chunk = bundle[filename] as OutputChunk | undefined if (chunk) { chunk.viteMetadata.importedCss.forEach((file) => { - deps.push(`/${file}`) + deps.push(join(config.base, file)) }) chunk.imports.forEach(addDeps) } diff --git a/playground/ssr-vue/vite.config.js b/playground/ssr-vue/vite.config.js index 83128683536388..dd3ff761d3476e 100644 --- a/playground/ssr-vue/vite.config.js +++ b/playground/ssr-vue/vite.config.js @@ -9,6 +9,7 @@ const nestedVirtualId = '\0' + nestedVirtualFile * @type {import('vite').UserConfig} */ module.exports = { + base: '/test/', plugins: [ vuePlugin(), vueJsx(),