Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 913c040

Browse filesBrowse files
authored
fix(sourcemap): improve sourcemap compatibility for vue2 (#16594)
1 parent 6a7dde5 commit 913c040
Copy full SHA for 913c040

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

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

Copy file name to clipboardExpand all lines: 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.