Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ export default function sourcemaps({
try {
code = (await promisifiedReadFile(id)).toString();
} catch {
this.warn('Failed reading file');
return null;
try {
// Try without a query suffix that some plugins use
code = (await promisifiedReadFile(id.replace(/\?.*$/, ''))).toString();
} catch (e) {
this.warn(`Failed reading file: ${e}`);
return null;
}
}

let map: ExistingRawSourceMap;
Expand Down