We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc8f9bc commit 5b9b9d5Copy full SHA for 5b9b9d5
packages/remix-serve/cli.ts
@@ -20,14 +20,16 @@ process.env.NODE_ENV = process.env.NODE_ENV ?? "production";
20
21
sourceMapSupport.install({
22
retrieveSourceMap: function (source) {
23
- // get source file with the `file://` prefix
24
- let match = source.match(/^file:\/\/(.*)$/);
+ let match = source.startsWith("file://");
25
if (match) {
26
let filePath = url.fileURLToPath(source);
27
- return {
28
- url: source,
29
- map: fs.readFileSync(`${filePath}.map`, "utf8"),
30
- };
+ let sourceMapPath = `${filePath}.map`;
+ if (fs.existsSync(sourceMapPath)) {
+ return {
+ url: source,
+ map: fs.readFileSync(sourceMapPath, "utf8"),
31
+ };
32
+ }
33
}
34
return null;
35
},
0 commit comments