Skip to content

Commit 913c040

Browse files
authoredMay 5, 2024··
fix(sourcemap): improve sourcemap compatibility for vue2 (#16594)
1 parent 6a7dde5 commit 913c040

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎packages/vite/src/node/server/sourcemap.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import convertSourceMap from 'convert-source-map'
44
import type { ExistingRawSourceMap, SourceMap } from 'rollup'
55
import type { Logger } from '../logger'
66
import { blankReplacer, createDebugger } from '../utils'
7+
import { cleanUrl } from '../../shared/utils'
78

89
const debug = createDebugger('vite:sourcemap', {
910
onlyWhenFocused: true,
@@ -53,7 +54,7 @@ export async function injectSourcesContent(
5354
// inject content from source file when sourcesContent is null
5455
sourceRootPromise ??= computeSourceRoute(map, file)
5556
const sourceRoot = await sourceRootPromise
56-
let resolvedSourcePath = decodeURI(sourcePath)
57+
let resolvedSourcePath = cleanUrl(decodeURI(sourcePath))
5758
if (sourceRoot) {
5859
resolvedSourcePath = path.resolve(sourceRoot, resolvedSourcePath)
5960
}

0 commit comments

Comments
 (0)
Please sign in to comment.