Skip to content

Commit e451d37

Browse files
committed
feat(browser): export replay worker from browser package
This avoids people from digging around in @sentry-internal/replay
1 parent e2d503e commit e451d37

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

packages/browser/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
"types": "build/npm/types/index.d.ts",
1818
"exports": {
1919
"./package.json": "./package.json",
20+
"./replay-worker": {
21+
"import": {
22+
"types": "./build/npm/types/replay-worker.d.ts",
23+
"default": "./build/npm/esm/replay-worker.js"
24+
},
25+
"require": {
26+
"types": "./build/npm/types/replay-worker.d.ts",
27+
"default": "./build/npm/cjs/replay-worker.js"
28+
}
29+
},
2030
".": {
2131
"import": {
2232
"types": "./build/npm/types/index.d.ts",

packages/browser/rollup.npm.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,15 @@ export default makeNPMConfigVariants(
1616
},
1717
},
1818
}),
19+
).concat(
20+
...['esm', 'cjs'].map(format => ({
21+
input: ['src/replay-worker.ts'],
22+
output: {
23+
file: `build/npm/${format}/replay-worker.js`,
24+
format: format,
25+
strict: false,
26+
},
27+
treeshake: false,
28+
external: ['@sentry-internal/replay/worker-bundler'],
29+
})),
1930
);

packages/browser/src/replay-worker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Forward to replay package
2+
import '@sentry-internal/replay/worker-bundler';

0 commit comments

Comments
 (0)