Skip to content

Commit

Permalink
fix: prefer inline sourcemaps which better support debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jun 3, 2021
1 parent da2bb85 commit c51aff7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/transform/create-transform.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from "fs";
import path from "path";
import crypto from "crypto";
import { Buffer } from "buffer";
import compiler from "marko/compiler";
import mergeMaps from "merge-source-map";
import ConcatMap from "concat-with-sourcemaps";
Expand Down Expand Up @@ -118,14 +119,13 @@ export default ({ browser }: { browser: boolean }) => {
map = concatMap.sourceMap;
}

if (!map) {
return code;
if (map) {
code += `\n//# sourceMappingURL=data:application/json;base64,${Buffer.from(
typeof map === "string" ? map : JSON.stringify(map)
).toString("base64")}`;
}

return {
code,
map,
};
return code;
},
};

Expand Down

0 comments on commit c51aff7

Please sign in to comment.