Skip to content

Commit

Permalink
Revert "Use file URL for source map paths (#1771)"
Browse files Browse the repository at this point in the history
This reverts commit 599f28b.
  • Loading branch information
cspotcode committed Jul 2, 2022
1 parent bf13086 commit 861f3e9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { relative, basename, extname, dirname, join, isAbsolute } from 'path';
import { relative, basename, extname, dirname, join } from 'path';
import { Module } from 'module';
import * as util from 'util';
import { fileURLToPath, pathToFileURL } from 'url';
import { fileURLToPath } from 'url';

import type * as _sourceMapSupport from '@cspotcode/source-map-support';
import { BaseError } from 'make-error';
Expand Down Expand Up @@ -1667,11 +1667,8 @@ function updateOutput(
*/
function updateSourceMap(sourceMapText: string, fileName: string) {
const sourceMap = JSON.parse(sourceMapText);
const outputFileName = isAbsolute(fileName)
? pathToFileURL(fileName).href
: fileName;
sourceMap.file = outputFileName;
sourceMap.sources = [outputFileName];
sourceMap.file = fileName;
sourceMap.sources = [fileName];
delete sourceMap.sourceRoot;
return JSON.stringify(sourceMap);
}
Expand Down

0 comments on commit 861f3e9

Please sign in to comment.