From 5127bb71cfbe3b840bff57b668a821c7a0f25f2d Mon Sep 17 00:00:00 2001 From: zakrepashe Date: Wed, 9 Oct 2024 16:23:18 +0300 Subject: [PATCH] fix(module): keep version for node ESM package Module federation needs package version for comparison fixes https://github.com/getsentry/sentry-javascript/discussions/12433 --- dev-packages/rollup-utils/plugins/make-esm-plugin.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev-packages/rollup-utils/plugins/make-esm-plugin.mjs b/dev-packages/rollup-utils/plugins/make-esm-plugin.mjs index 04dd68beaa1c..ad18856c011a 100644 --- a/dev-packages/rollup-utils/plugins/make-esm-plugin.mjs +++ b/dev-packages/rollup-utils/plugins/make-esm-plugin.mjs @@ -15,9 +15,12 @@ export function makePackageNodeEsm() { const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8')); const sideEffects = packageJSON.sideEffects; + // For module federation we need to keep the version of the package + const version = packageJSON.version; const newPackageJSON = { type: 'module', + version, sideEffects, };