Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sourcemapIgnoreList configuration option #12174

Merged
merged 8 commits into from
Mar 1, 2023
Prev Previous commit
Next Next commit
refactor: combine with loop from #12079
  • Loading branch information
danielroe committed Feb 27, 2023
commit 61bcf54be40c4ef8f7f2384709dd4cc98933b987
13 changes: 3 additions & 10 deletions packages/vite/src/node/server/transformRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ async function loadAndTransform(

if (map && mod.file) {
map = (typeof map === 'string' ? JSON.parse(map) : map) as SourceMap
if (map.mappings && !map.sourcesContent) {
await injectSourcesContent(map, mod.file, logger)
}
for (
let sourcesIndex = 0;
sourcesIndex < map.sources.length;
Expand All @@ -291,16 +294,6 @@ async function loadAndTransform(
map.x_google_ignoreList.push(sourcesIndex)
}
}
}
if (map.mappings && !map.sourcesContent) {
await injectSourcesContent(map, mod.file, logger)
}
for (
let sourcesIndex = 0;
sourcesIndex < map.sources.length;
++sourcesIndex
) {
const sourcePath = map.sources[sourcesIndex]

// Rewrite sources to relative paths to give debuggers the chance
// to resolve and display them in a meaningful way (rather than
Expand Down