diff --git a/packages/vite/src/plugins/ssr-styles.ts b/packages/vite/src/plugins/ssr-styles.ts index 46a6e5345f..56afc02312 100644 --- a/packages/vite/src/plugins/ssr-styles.ts +++ b/packages/vite/src/plugins/ssr-styles.ts @@ -2,7 +2,7 @@ import { pathToFileURL } from 'node:url' import type { Plugin } from 'vite' import { dirname, relative } from 'pathe' import { genImport, genObjectFromRawEntries } from 'knitwork' -import { filename } from 'pathe/utils' +import { filename as _filename } from 'pathe/utils' import { parseQuery, parseURL } from 'ufo' import type { Component } from '@nuxt/schema' import MagicString from 'magic-string' @@ -235,3 +235,7 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin { } } } + +function filename (name: string) { + return _filename(name.replace(/\?.+$/, '')) +}