Skip to content

Commit 84188a2

Browse files
committed
chore: remove ts and terser from replay
1 parent 1c14ce0 commit 84188a2

File tree

5 files changed

+25
-47
lines changed

5 files changed

+25
-47
lines changed

packages/replay-internal/rollup.npm.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import nodeResolve from '@rollup/plugin-node-resolve';
21
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
32

43
export default makeNPMConfigVariants(
@@ -20,6 +19,5 @@ export default makeNPMConfigVariants(
2019
format,
2120
},
2221
treeshake: false,
23-
plugins: [nodeResolve()],
2422
})),
2523
);

packages/replay-worker/rollup.examples.config.mjs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
1-
import terser from '@rollup/plugin-terser';
2-
import typescript from '@rollup/plugin-typescript';
3-
import { defineConfig } from 'rollup';
4-
import { makeLicensePlugin } from '../../dev-packages/rollup-utils/plugins/index.mjs';
5-
6-
const licensePlugin = makeLicensePlugin('Sentry Replay Worker');
1+
import { defineConfig } from 'rolldown';
72

83
const config = defineConfig([
94
{
105
input: ['./src/_worker.ts'],
6+
tsconfig: './tsconfig.build.json',
117
output: {
128
file: './examples/worker.js',
139
format: 'esm',
1410
},
1511
treeshake: 'smallest',
16-
plugins: [
17-
typescript({ tsconfig: './tsconfig.json', inlineSourceMap: false, sourceMap: false, inlineSources: false }),
18-
licensePlugin,
19-
],
2012
},
2113
{
2214
input: ['./src/_worker.ts'],
15+
tsconfig: './tsconfig.build.json',
2316
output: {
2417
file: './examples/worker.min.js',
2518
format: 'esm',
2619
},
2720
treeshake: 'smallest',
28-
plugins: [
29-
typescript({ tsconfig: './tsconfig.json', inlineSourceMap: false, sourceMap: false, inlineSources: false }),
30-
terser({
31-
mangle: {
32-
module: true,
33-
},
34-
}),
35-
licensePlugin,
36-
],
3721
},
3822
]);
3923

packages/replay-worker/rollup.worker.config.mjs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,29 @@
11
// inspired by https://justinribeiro.com/chronicle/2020/07/17/building-module-web-workers-for-cross-browser-compatibility-with-rollup/
22

3-
import terser from '@rollup/plugin-terser';
4-
import typescript from '@rollup/plugin-typescript';
5-
import { defineConfig } from 'rollup';
3+
import { defineConfig } from 'rolldown';
64

75
const config = defineConfig([
86
{
97
input: ['./src/index.ts'],
108
treeshake: 'smallest',
9+
tsconfig: './tsconfig.build.json',
1110
output: {
1211
dir: './build/esm',
1312
format: 'esm',
13+
minify: true,
1414
},
1515
external: ['./worker'],
16-
plugins: [
17-
typescript({ tsconfig: './tsconfig.json', inlineSourceMap: false, sourceMap: false, inlineSources: false }),
18-
terser({
19-
mangle: {
20-
module: true,
21-
},
22-
}),
23-
],
2416
},
2517
{
2618
input: ['./src/_worker.ts'],
19+
tsconfig: './tsconfig.build.json',
2720
output: {
2821
file: './build/esm/worker.ts',
2922
format: 'esm',
23+
minify: true,
3024
},
3125
treeshake: 'smallest',
3226
plugins: [
33-
typescript({ tsconfig: './tsconfig.json', inlineSourceMap: false, sourceMap: false, inlineSources: false }),
34-
terser({
35-
mangle: {
36-
module: true,
37-
},
38-
}),
3927
{
4028
name: 'worker-to-string',
4129
renderChunk(code) {
@@ -46,19 +34,13 @@ const config = defineConfig([
4634
},
4735
{
4836
input: ['./src/_worker.ts'],
37+
tsconfig: './tsconfig.build.json',
4938
output: {
5039
file: './build/esm/worker-bundler.js',
5140
format: 'esm',
41+
minify: true,
5242
},
5343
treeshake: 'smallest',
54-
plugins: [
55-
typescript({ tsconfig: './tsconfig.json', inlineSourceMap: false, sourceMap: false, inlineSources: false }),
56-
terser({
57-
mangle: {
58-
module: true,
59-
},
60-
}),
61-
],
6244
},
6345
]);
6446

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"lib": ["webworker", "scripthost"],
6+
"esModuleInterop": true,
7+
"target": "es2020",
8+
"strictPropertyInitialization": false
9+
},
10+
"include": ["src/**/*.ts"]
11+
}

packages/replay-worker/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"lib": ["webworker", "scripthost"],
66
"esModuleInterop": true,
77
"target": "es2020",
8-
"strictPropertyInitialization": false
8+
"strictPropertyInitialization": false,
9+
"inlineSourceMap": false,
10+
"sourceMap": false,
11+
"inlineSources": false
912
},
1013
"include": ["src/**/*.ts"]
1114
}

0 commit comments

Comments
 (0)