File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
packages/node-experimental Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1+ import { makeBaseBundleConfig } from '@sentry-internal/rollup-utils' ;
2+
3+ function createAnrWorkerConfig ( destDir , esm ) {
4+ return makeBaseBundleConfig ( {
5+ bundleType : 'node-worker' ,
6+ entrypoints : [ 'src/integrations/anr/worker.ts' ] ,
7+ jsVersion : 'es6' ,
8+ licenseTitle : '@sentry/node' ,
9+ outputFileBase : ( ) => 'worker-script.js' ,
10+ packageSpecificConfig : {
11+ output : {
12+ dir : destDir ,
13+ sourcemap : false ,
14+ } ,
15+ plugins : [
16+ {
17+ name : 'output-base64-worker-script' ,
18+ renderChunk ( code ) {
19+ const base64Code = Buffer . from ( code ) . toString ( 'base64' ) ;
20+ if ( esm ) {
21+ return `export const base64WorkerScript = '${ base64Code } ';` ;
22+ } else {
23+ return `exports.base64WorkerScript = '${ base64Code } ';` ;
24+ }
25+ } ,
26+ } ,
27+ ] ,
28+ } ,
29+ } ) ;
30+ }
31+
32+ export const anrWorkerConfigs = [
33+ createAnrWorkerConfig ( 'build/esm/integrations/anr' , true ) ,
34+ createAnrWorkerConfig ( 'build/cjs/integrations/anr' , false ) ,
35+ ] ;
Original file line number Diff line number Diff line change 11import { makeBaseNPMConfig , makeNPMConfigVariants } from '@sentry-internal/rollup-utils' ;
2+ import { anrWorkerConfigs } from './rollup.anr-worker.config.mjs' ;
23
3- export default makeNPMConfigVariants ( makeBaseNPMConfig ( ) ) ;
4+ export default [
5+ ...makeNPMConfigVariants ( makeBaseNPMConfig ( ) ) ,
6+ // The ANR worker builds must come after the main build because they overwrite the worker-script.js file
7+ ...anrWorkerConfigs ,
8+ ] ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export { getAutoPerformanceIntegrations } from './integrations/tracing';
2626export { getClient , getSentryRelease , defaultStackParser } from './sdk/api' ;
2727export { createGetModuleFromFilename } from './utils/module' ;
2828export { makeNodeTransport } from './transports' ;
29+ export { NodeClient } from './sdk/client' ;
2930// eslint-disable-next-line deprecation/deprecation
3031export { getCurrentHub } from './sdk/hub' ;
3132export { cron } from './cron' ;
You can’t perform that action at this time.
0 commit comments