Skip to content

Commit bc641d1

Browse files
committed
fix dep and add comment
1 parent 0ad353f commit bc641d1

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

packages/replay-worker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
},
4747
"homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
4848
"devDependencies": {
49+
"@rollup/plugin-commonjs": "^21.0.1",
4950
"@types/pako": "^2.0.0"
5051
},
5152
"dependencies": {
52-
"@rollup/plugin-commonjs": "25.0.7",
5353
"pako": "2.1.0"
5454
},
5555
"engines": {

packages/replay-worker/src/Compressor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import type * as PakoTypes from 'pako';
22
// @ts-expect-error no types here
33
import * as pako from 'pako/lib/deflate.js';
44

5+
// NOTE: We have to do this weird workaround because by default,
6+
// pako does not treeshake when importing from 'pako'.
7+
// In order to get proper tree shaking, we have to import from 'pako/lib/deflate.js',
8+
// Which is not great but works
9+
// types come from @types/pako, so we can safely use them by casting
510
const Deflate = (pako as typeof PakoTypes).Deflate;
611
const deflate = (pako as typeof PakoTypes).deflate;
712
const constants = (pako as typeof PakoTypes).constants;

yarn.lock

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4753,18 +4753,6 @@
47534753
is-reference "1.2.1"
47544754
magic-string "^0.27.0"
47554755

4756-
4757-
version "25.0.7"
4758-
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.7.tgz#145cec7589ad952171aeb6a585bbeabd0fd3b4cf"
4759-
integrity sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==
4760-
dependencies:
4761-
"@rollup/pluginutils" "^5.0.1"
4762-
commondir "^1.0.1"
4763-
estree-walker "^2.0.2"
4764-
glob "^8.0.3"
4765-
is-reference "1.2.1"
4766-
magic-string "^0.30.3"
4767-
47684756
"@rollup/plugin-commonjs@^15.0.0":
47694757
version "15.1.0"
47704758
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz#1e7d076c4f1b2abf7e65248570e555defc37c238"

0 commit comments

Comments
 (0)