diff --git a/packages/browser-utils/rollup.npm.config.mjs b/packages/browser-utils/rollup.npm.config.mjs index d28a7a6f54a0..e616bb7c0d70 100644 --- a/packages/browser-utils/rollup.npm.config.mjs +++ b/packages/browser-utils/rollup.npm.config.mjs @@ -9,7 +9,7 @@ export default makeNPMConfigVariants( // set preserveModules to true because we don't want to bundle everything into one file. preserveModules: process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined - ? true + ? false : Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES), }, }, diff --git a/packages/browser/rollup.npm.config.mjs b/packages/browser/rollup.npm.config.mjs index 00251eea81fd..3eda31f6b4ec 100644 --- a/packages/browser/rollup.npm.config.mjs +++ b/packages/browser/rollup.npm.config.mjs @@ -11,7 +11,7 @@ export default makeNPMConfigVariants( // set preserveModules to true because we don't want to bundle everything into one file. preserveModules: process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined - ? true + ? false : Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES), }, }, diff --git a/packages/bun/rollup.npm.config.mjs b/packages/bun/rollup.npm.config.mjs index 84a06f2fb64a..5d117fce85b3 100644 --- a/packages/bun/rollup.npm.config.mjs +++ b/packages/bun/rollup.npm.config.mjs @@ -1,3 +1,9 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; -export default makeNPMConfigVariants(makeBaseNPMConfig()); +export default makeNPMConfigVariants(makeBaseNPMConfig({ + packageSpecificConfig: { + output: { + preserveModules: false + } + } +})); diff --git a/packages/core/rollup.npm.config.mjs b/packages/core/rollup.npm.config.mjs index cc3ad4064820..bf90179a654f 100644 --- a/packages/core/rollup.npm.config.mjs +++ b/packages/core/rollup.npm.config.mjs @@ -23,7 +23,7 @@ export default makeNPMConfigVariants( // set preserveModules to true because we don't want to bundle everything into one file. preserveModules: process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined - ? true + ? false : Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES), }, plugins: [ diff --git a/packages/deno/rollup.npm.config.mjs b/packages/deno/rollup.npm.config.mjs index 41a1be69695d..33f8cfe8b978 100644 --- a/packages/deno/rollup.npm.config.mjs +++ b/packages/deno/rollup.npm.config.mjs @@ -1,3 +1,9 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; -export default makeNPMConfigVariants(makeBaseNPMConfig(), { emitCjs: false }); +export default makeNPMConfigVariants(makeBaseNPMConfig({ + packageSpecificConfig: { + output: { + preserveModules: false + } + } +}), { emitCjs: false }); diff --git a/packages/nestjs/rollup.npm.config.mjs b/packages/nestjs/rollup.npm.config.mjs index 0ce71546935c..471538590833 100644 --- a/packages/nestjs/rollup.npm.config.mjs +++ b/packages/nestjs/rollup.npm.config.mjs @@ -3,5 +3,8 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu export default makeNPMConfigVariants( makeBaseNPMConfig({ entrypoints: ['src/index.ts', 'src/setup.ts'], + output: { + preserveModules: false + } }), ); diff --git a/packages/node-core/rollup.npm.config.mjs b/packages/node-core/rollup.npm.config.mjs index 8e18333836ef..4b35c2c7d881 100644 --- a/packages/node-core/rollup.npm.config.mjs +++ b/packages/node-core/rollup.npm.config.mjs @@ -24,7 +24,7 @@ export default [ output: { // set exports to 'named' or 'auto' so that rollup doesn't warn exports: 'named', - preserveModules: true, + preserveModules: false, }, plugins: [ replace({ diff --git a/packages/node-native/rollup.npm.config.mjs b/packages/node-native/rollup.npm.config.mjs index ce79b0ac9bbb..0ed0fe26a2cc 100644 --- a/packages/node-native/rollup.npm.config.mjs +++ b/packages/node-native/rollup.npm.config.mjs @@ -8,7 +8,7 @@ export default makeNPMConfigVariants( dir: 'build', // set exports to 'named' or 'auto' so that rollup doesn't warn exports: 'named', - preserveModules: true, + preserveModules: false, }, }, }), diff --git a/packages/node/rollup.npm.config.mjs b/packages/node/rollup.npm.config.mjs index 93fd1d8c16ca..250dc76d87c0 100644 --- a/packages/node/rollup.npm.config.mjs +++ b/packages/node/rollup.npm.config.mjs @@ -9,7 +9,7 @@ export default [ output: { // set exports to 'named' or 'auto' so that rollup doesn't warn exports: 'named', - preserveModules: true, + preserveModules: false, }, }, }), diff --git a/packages/react/rollup.npm.config.mjs b/packages/react/rollup.npm.config.mjs index 923dfafb85d7..be4bac90634f 100644 --- a/packages/react/rollup.npm.config.mjs +++ b/packages/react/rollup.npm.config.mjs @@ -3,6 +3,9 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu export default makeNPMConfigVariants( makeBaseNPMConfig({ packageSpecificConfig: { + output: { + preserveModules: true, + }, external: ['react', 'react/jsx-runtime'], }, sucrase: {