Skip to content

Commit

Permalink
fix(importAnalysis): skip encode in ssr (#16213)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Mar 20, 2024
1 parent ee4d2bc commit e4d2d60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/plugins/importAnalysis.ts
Expand Up @@ -594,7 +594,9 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
rewriteDone = true
}
if (!rewriteDone) {
const rewrittenUrl = JSON.stringify(partialEncodeURIPath(url))
const rewrittenUrl = JSON.stringify(
ssr ? url : partialEncodeURIPath(url),
)
const s = isDynamicImport ? start : start - 1
const e = isDynamicImport ? end : end + 1
str().overwrite(s, e, rewrittenUrl, {
Expand Down

0 comments on commit e4d2d60

Please sign in to comment.