Skip to content

Commit 8aedaed

Browse files
authored
Revert "Use file URL for source map paths (#1771)" (#1821)
This reverts commit 599f28b.
1 parent bf13086 commit 8aedaed

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/index.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { relative, basename, extname, dirname, join, isAbsolute } from 'path';
1+
import { relative, basename, extname, dirname, join } from 'path';
22
import { Module } from 'module';
33
import * as util from 'util';
4-
import { fileURLToPath, pathToFileURL } from 'url';
4+
import { fileURLToPath } from 'url';
55

66
import type * as _sourceMapSupport from '@cspotcode/source-map-support';
77
import { BaseError } from 'make-error';
@@ -1667,11 +1667,8 @@ function updateOutput(
16671667
*/
16681668
function updateSourceMap(sourceMapText: string, fileName: string) {
16691669
const sourceMap = JSON.parse(sourceMapText);
1670-
const outputFileName = isAbsolute(fileName)
1671-
? pathToFileURL(fileName).href
1672-
: fileName;
1673-
sourceMap.file = outputFileName;
1674-
sourceMap.sources = [outputFileName];
1670+
sourceMap.file = fileName;
1671+
sourceMap.sources = [fileName];
16751672
delete sourceMap.sourceRoot;
16761673
return JSON.stringify(sourceMap);
16771674
}

0 commit comments

Comments
 (0)