Skip to content

Commit

Permalink
fix(vite): strip query strings for style chunk filenames (#25764)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 13, 2024
1 parent 75f05e9 commit 3ac8b18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/plugins/ssr-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -235,3 +235,7 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin {
}
}
}

function filename (name: string) {
return _filename(name.replace(/\?.+$/, ''))
}

0 comments on commit 3ac8b18

Please sign in to comment.