Skip to content

Commit 6866a6e

Browse files
committed
changing tar gzip strategy
1 parent e6612f2 commit 6866a6e

File tree

1 file changed

+5
-4
lines changed
  • packages/faro-bundlers-shared/src

1 file changed

+5
-4
lines changed

packages/faro-bundlers-shared/src/index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import crypto from "crypto";
22
import fs from "fs";
3-
import { create } from "tar";
3+
import { Readable } from "stream";
4+
import { Pack, create } from "tar";
45
import fetch from "cross-fetch";
56
import { ansi256 } from "ansis";
67

@@ -86,16 +87,16 @@ export const uploadCompressedSourceMaps = async (
8687
): Promise<boolean> => {
8788
const { sourcemapEndpoint, stackId, files, keepSourcemaps, apiKey, verbose } = options;
8889

89-
let sourcemapBuffer,
90+
let sourcemapBuffer: Readable,
9091
success = true;
9192

92-
sourcemapBuffer = await create({ gzip: true }, files);
93+
sourcemapBuffer = Readable.from(create({ z: true }, files));
9394

9495
verbose &&
9596
consoleInfoOrange(
9697
`Uploading ${files
9798
.map((file) => file.split("/").pop())
98-
.join(", ")} to ${sourcemapEndpoint}`
99+
.join(", ")} to ${sourcemapEndpoint} - total size ${sourcemapBuffer.readableLength} bytes`
99100
);
100101
await fetch(sourcemapEndpoint, {
101102
method: "POST",

0 commit comments

Comments
 (0)