Skip to content

Commit 96d3372

Browse files
committed
use monorepo's makeBaseNpmConfig
1 parent 85af813 commit 96d3372

File tree

2 files changed

+30
-37
lines changed

2 files changed

+30
-37
lines changed

packages/replay/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "@sentry/replay",
33
"version": "7.22.0",
44
"description": "User replays for Sentry",
5-
"main": "build/npm/dist/index.js",
6-
"module": "build/npm/dist/index.es.js",
7-
"types": "build/npm/dist/src/index.d.ts",
5+
"main": "build/npm/cjs/index.js",
6+
"module": "build/npm/esm/index.js",
7+
"types": "build/npm/types/src/index.d.ts",
88
"sideEffects": false,
99
"scripts": {
1010
"bootstrap": "yarn && cd demo && yarn #TODO: change after migration",

packages/replay/rollup.npm.config.js

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
11
import replace from '@rollup/plugin-replace';
2-
import typescript from '@rollup/plugin-typescript';
3-
import { defineConfig } from 'rollup';
2+
3+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index';
44

55
import pkg from './package.json';
66

7-
const config = defineConfig({
8-
input: './src/index.ts',
9-
output: [
10-
{
11-
file: pkg.main,
12-
format: 'cjs',
13-
sourcemap: true,
14-
},
15-
{
16-
file: pkg.module,
17-
format: 'esm',
18-
},
19-
],
20-
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
21-
plugins: [
22-
typescript({
23-
tsconfig: './tsconfig.json',
24-
}),
25-
replace({
26-
// __SENTRY_DEBUG__ should be save to replace in any case, so no checks for assignments necessary
27-
preventAssignment: false,
28-
values: {
29-
__SENTRY_REPLAY_VERSION__: JSON.stringify(pkg.version),
30-
// @ts-ignore not gonna deal with types here
31-
__SENTRY_DEBUG__: true,
32-
// @ts-ignore not gonna deal with types here
33-
__DEBUG_BUILD__: true,
7+
export default makeNPMConfigVariants(
8+
makeBaseNPMConfig({
9+
hasBundles: true,
10+
packageSpecificConfig: {
11+
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
12+
plugins: [
13+
replace({
14+
// __SENTRY_DEBUG__ should be save to replace in any case, so no checks for assignments necessary
15+
preventAssignment: false,
16+
values: {
17+
__SENTRY_REPLAY_VERSION__: JSON.stringify(pkg.version),
18+
// @ts-ignore not gonna deal with types here
19+
__SENTRY_DEBUG__: true,
20+
// @ts-ignore not gonna deal with types here
21+
__DEBUG_BUILD__: true,
22+
},
23+
}),
24+
],
25+
output: {
26+
// set exports to 'named' or 'auto' so that rollup doesn't warn about
27+
// the default export in `worker/worker.js`
28+
exports: 'named',
3429
},
35-
}),
36-
],
37-
});
38-
39-
export default config;
30+
},
31+
}),
32+
);

0 commit comments

Comments
 (0)