File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 7
7
"types" : " build/npm/types/index.d.ts" ,
8
8
"sideEffects" : false ,
9
9
"scripts" : {
10
+ "build" : " run-s build:worker && run-p build:core build:types build:bundle" ,
10
11
"build:rollup" : " run-s build:worker build:core" ,
11
- "build" : " run-s build:worker && run-p build:core build:types " ,
12
+ "build:bundle " : " rollup -c rollup.bundle.config.js " ,
12
13
"build:dev" : " run-s build #TODO adjust after adding CDN bundles" ,
13
14
"build:worker" : " rollup -c rollup.config.worker.js" ,
14
15
"build:core" : " rollup -c rollup.npm.config.js" ,
Original file line number Diff line number Diff line change
1
+ import commonjs from '@rollup/plugin-commonjs' ;
2
+ import replace from '@rollup/plugin-replace' ;
3
+
4
+ import { makeBaseBundleConfig , makeBundleConfigVariants } from '../../rollup/index.js' ;
5
+
6
+ import pkg from './package.json' ;
7
+
8
+ const baseBundleConfig = makeBaseBundleConfig ( {
9
+ bundleType : 'addon' ,
10
+ entrypoints : [ 'src/index.ts' ] ,
11
+ jsVersion : 'es6' ,
12
+ licenseTitle : '@sentry/replay' ,
13
+ outputFileBase : ( ) => 'bundles/replay' ,
14
+ packageSpecificConfig : {
15
+ // We don't add @sentry/browser to the bundle, hence we mark peerDeps as external
16
+ external : [ ...Object . keys ( pkg . peerDependencies || { } ) ] ,
17
+ plugins : [
18
+ replace ( {
19
+ preventAssignment : true ,
20
+ values : {
21
+ __SENTRY_REPLAY_VERSION__ : JSON . stringify ( pkg . version ) ,
22
+ } ,
23
+ } ) ,
24
+ commonjs ( ) ,
25
+ ] ,
26
+ output : {
27
+ // set exports to 'named' or 'auto' so that rollup doesn't warn about
28
+ // the default export in `worker/worker.js`
29
+ exports : 'auto' ,
30
+ } ,
31
+ } ,
32
+ } ) ;
33
+
34
+ const builds = makeBundleConfigVariants ( baseBundleConfig ) ;
35
+
36
+ export default builds ;
You can’t perform that action at this time.
0 commit comments